Class FieldProperty

  • All Implemented Interfaces:
    Property

    public class FieldProperty
    extends AbstractProperty
    Property which encapsulates a simple field.
    • Constructor Detail

      • FieldProperty

        public FieldProperty​(ObjectifyFactory fact,
                             Class<?> examinedClass,
                             Field field)
        Parameters:
        examinedClass - is the actual top level concrete class we are examining; the field might be declared on a superclass of this class so it's not the same as field.getDeclaringClass()
    • Method Detail

      • getType

        public Type getType()
        Description copied from interface: Property
        Get the real generic type of the field
      • set

        public void set​(Object pojo,
                        Object value)
        Description copied from interface: Property
        Actually set the property (field or method) on an object
      • get

        public Object get​(Object pojo)
        Description copied from interface: Property
        Get the value of the property (field) if possible, or null if not possible (method)
      • isSaved

        public boolean isSaved​(Object onPojo)
        Returns:
        true if this field should be saved, false if not
      • getIndexInstruction

        public Boolean getIndexInstruction​(Object onPojo)
        Description copied from interface: Property
        Gets the index instruction for this property, if there is one. Properties do not necessarily have a specific index or unindex instruction, and even if they do, the instruction might be conditional. Also factors in any index instruction on the class as a default. However, explicit index instruction on the field overrides the class.
        Returns:
        true if this field should be indexed, false if it should be unindexed, null is "no information, continue with defaults".