Last active
August 29, 2015 14:14
-
-
Save crowjdh/f5443fd7e29ee6accfd2 to your computer and use it in GitHub Desktop.
Restrict integer parameter and return value.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private int mProperty; | |
@IntDef(value = { PROPERTY_A, PROPERTY_B }) | |
@Retention(RetentionPolicy.SOURCE) | |
public @interface MyProperty {} | |
public void setProperty(@MyProperty int property) { | |
mProperty = Property; | |
} | |
public @MyProperty int getProperty() { | |
return mProperty; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment