Annotation Type FieldSerializer.Optional

Enclosing class:
FieldSerializer<T,C extends FieldSerializerConfig>

@Retention(RUNTIME) @Target(FIELD) public static @interface FieldSerializer.Optional
Indicates a field should be ignored when its declaring class is registered unless the context has a value set for the specified key. This can be useful when a field must be serialized for one purpose, but not for another. Eg, a class for a networked application could have a field that should not be serialized and sent to clients, but should be serialized when stored on the server.
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
     
  • Element Details