@Target(value=FIELD) @Retention(value=RUNTIME) public @interface Key
If the data key name is not specified, the default is the Java field's name. For example:
public class A {
// uses data key name of "dataKeyNameMatchesFieldName"
@Key
public String dataKeyNameMatchesFieldName;
// uses data key name of "some_other_name"
@Key("some_other_name")
private String dataKeyNameIsOverridden;
// not a data key
private String notADataKey;
}
public abstract String value
"##default"
to use the Java field's name.Copyright © 2011–2021 Google. All rights reserved.