Package com.googlecode.objectify.impl
Class FieldProperty
- java.lang.Object
-
- com.googlecode.objectify.impl.AbstractProperty
-
- com.googlecode.objectify.impl.FieldProperty
-
- All Implemented Interfaces:
Property
public class FieldProperty extends AbstractProperty
Property which encapsulates a simple field.
-
-
Constructor Summary
Constructors Constructor Description FieldProperty(ObjectifyFactory fact, Class<?> examinedClass, Field field)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
get(Object pojo)
Get the value of the property (field) if possible, or null if not possible (method)Boolean
getIndexInstruction(Object onPojo)
Gets the index instruction for this property, if there is one.Type
getType()
Get the real generic type of the fieldboolean
isSaved(Object onPojo)
void
set(Object pojo, Object value)
Actually set the property (field or method) on an objectString
toString()
-
Methods inherited from class com.googlecode.objectify.impl.AbstractProperty
getAnnotation, getAnnotations, getLoadNames, getName
-
-
-
-
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".
-
-