com.rt.storage.api.client.util.Value Maven / Gradle / Ivy
package com.rt.storage.api.client.util;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Use this annotation to specify that an enum constant is a string data value, optionally providing
* the string data value to use.
*
* If the string data value is not specified, the default is the Java field's name. For example:
*
*
* public enum A {
*
* // value is "USE_FIELD_NAME"
* @Value
* USE_FIELD_NAME,
*
* // value is "specifiedValue"
* @Value("specifiedValue")
* USE_SPECIFIED_VALUE,
*
* // value is null
* @NullValue
* NULL_VALUE
*
* // not a value
* NOT_A_VALUE
* }
*
*
* @since 1.4
* @author Yaniv Inbar
*/
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Value {
/**
* Override the string data value of the field or {@code "##default"} to use the Java field's
* name.
*/
String value() default "##default";
}