Created
March 7, 2014 15:02
-
-
Save elucidator/9413055 to your computer and use it in GitHub Desktop.
Gist for the NamedPRoperty Annotation
This file contains 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
@Retention(RUNTIME) | |
@Target({FIELD, METHOD}) | |
@Qualifier | |
public @interface NamedProperty { | |
/** | |
* key or name of the property | |
* | |
* @return a valid key or "" | |
*/ | |
@Nonbinding String key() default ""; | |
/** | |
* Is it a mandatory property. When key is not found in the configuration it | |
* throws a {{@link java.lang.IllegalArgumentException}} | |
* | |
* @return true if mandatory | |
*/ | |
@Nonbinding boolean mandatory() default false; | |
/** | |
* Default value if not provided | |
* | |
* @return default value or "" | |
*/ | |
@Nonbinding String defaultValue() default ""; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment