Annotation Interface SchemaFieldName


@Documented @Retention(RUNTIME) @Target({FIELD,METHOD}) public @interface SchemaFieldName
When used on a POJO field, a Java Bean getter, or an AutoValue getter, the specified name is used for the generated schema field.

For example, say we have a Java POJO with a field that we want in our schema but under a different name:


  @DefaultSchema(JavaFieldSchema.class)
   class MyClass {
     public String user;

    @SchemaFieldName("age")
     public int ageInYears;
   }
 

The resulting schema will have fields named "user" and "age."

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The name to use for the generated schema field.
  • Element Details

    • value

      The name to use for the generated schema field.