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
- Author:
- Yaniv Inbar
-
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.voidSets this field in the given object to the given value using reflection.
-
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
-
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
-