Class FieldInfo
java.lang.Object
com.google.api.client.util.FieldInfo
Parses field information to determine data key name/value pair associated with the field.
Implementation is thread-safe.
- Since:
- 1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionCached field information.private final FieldField.private final booleanWhether the field class is "primitive" as defined byData.isPrimitive(Type).private final Stringprivate final Method[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends Enum<T>>
TReturns the class information of the field's declaring class.getField()Returns the field.static ObjectgetFieldValue(Field field, Object obj) Returns the value of the given field in the given object using reflection.Returns the field's generic type, which is a class, parameterized type, generic array type, or type variable, but not a wildcard type.getName()Class<?> getType()Returns the field's type.Returns the value of the field in the given object instance using reflection.booleanisFinal()Returns whether the field is final.booleanReturns whether the field is primitive as defined byData.isPrimitive(Type).static FieldInfoReturns the field information for the given enum value.static FieldInfoReturns the field information for the given field.static voidsetFieldValue(Field field, Object obj, Object value) Sets the given field in the given object to the given value using reflection.private Method[]settersMethodForField(Field field) Creates list of setter methods for a field only in declaring class.voidSets this field in the given object to the given value using reflection.
-
Field Details
-
CACHE
-
isPrimitive
private final boolean isPrimitiveWhether the field class is "primitive" as defined byData.isPrimitive(Type). -
field
Field. -
setters
-
name
-
-
Constructor Details
-
FieldInfo
-
-
Method Details
-
of
Returns the field information for the given enum value.- Parameters:
enumValue- enum value- Returns:
- field information
- Throws:
IllegalArgumentException- if the enum value has no value annotation- Since:
- 1.4
-
of
-
settersMethodForField
-
getField
-
getName
-
getType
-
getGenericType
Returns the field's generic type, which is a class, parameterized type, generic array type, or type variable, but not a wildcard type.- Since:
- 1.4
-
isFinal
public boolean isFinal()Returns whether the field is final.- Since:
- 1.4
-
isPrimitive
public boolean isPrimitive()Returns whether the field is primitive as defined byData.isPrimitive(Type).- Since:
- 1.4
-
getValue
-
setValue
-
getClassInfo
Returns the class information of the field's declaring class. -
enumValue
-
getFieldValue
-
setFieldValue
-