Returns the data key name associated with the field for a non-enum-constant with a Key
annotation, or data key value associated with the enum constant with a Value annotation
or null for an enum constant with a NullValue annotation.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Class FieldInfo (2.0.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.0.0 (latest)](/java/docs/reference/google-http-client/latest/com.google.api.client.util.FieldInfo)\n- [1.47.1](/java/docs/reference/google-http-client/1.47.1/com.google.api.client.util.FieldInfo)\n- [1.46.3](/java/docs/reference/google-http-client/1.46.3/com.google.api.client.util.FieldInfo)\n- [1.45.3](/java/docs/reference/google-http-client/1.45.3/com.google.api.client.util.FieldInfo)\n- [1.44.2](/java/docs/reference/google-http-client/1.44.2/com.google.api.client.util.FieldInfo)\n- [1.43.2](/java/docs/reference/google-http-client/1.43.2/com.google.api.client.util.FieldInfo)\n- [1.42.3](/java/docs/reference/google-http-client/1.42.3/com.google.api.client.util.FieldInfo)\n- [1.41.8](/java/docs/reference/google-http-client/1.41.8/com.google.api.client.util.FieldInfo) \n\n public class FieldInfo\n\nParses field information to determine data key name/value pair associated with the field.\n\nImplementation is thread-safe. \n\nInheritance\n-----------\n\n[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e FieldInfo \n\nInherited Members\n-----------------\n\n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)\n\nStatic Methods\n--------------\n\n### getFieldValue(Field field, Object obj)\n\n public static Object getFieldValue(Field field, Object obj)\n\nReturns the value of the given field in the given object using reflection.\n\n### of(Enum\\\u003c?\\\u003e enumValue)\n\n public static FieldInfo of(Enum\u003c?\u003e enumValue)\n\nReturns the field information for the given enum value.\n\n### of(Field field)\n\n public static FieldInfo of(Field field)\n\nReturns the field information for the given field.\n\n### setFieldValue(Field field, Object obj, Object value)\n\n public static void setFieldValue(Field field, Object obj, Object value)\n\nSets the given field in the given object to the given value using reflection.\n\nIf the field is final, it checks that the value being set is identical to the existing\nvalue.\n\nMethods\n-------\n\n### \\\u003cT\\\u003eenumValue()\n\n public T \u003cT\u003eenumValue()\n\n### getClassInfo()\n\n public ClassInfo getClassInfo()\n\nReturns the class information of the field's declaring class.\n\n### getField()\n\n public Field getField()\n\nReturns the field.\n\n### getGenericType()\n\n public Type getGenericType()\n\nReturns the field's generic type, which is a class, parameterized type, generic array type, or\ntype variable, but not a wildcard type.\n\n### getName()\n\n public String getName()\n\nReturns the data key name associated with the field for a non-enum-constant with a [Key](/java/docs/reference/google-http-client/latest/com.google.api.client.util.Key)\nannotation, or data key value associated with the enum constant with a [Value](/java/docs/reference/google-http-client/latest/com.google.api.client.util.Value) annotation\nor `null` for an enum constant with a [NullValue](/java/docs/reference/google-http-client/latest/com.google.api.client.util.NullValue) annotation.\n\nThis string is interned.\n\n### getType()\n\n public Class\u003c?\u003e getType()\n\nReturns the field's type.\n\n### getValue(Object obj)\n\n public Object getValue(Object obj)\n\nReturns the value of the field in the given object instance using reflection.\n\n### isFinal()\n\n public boolean isFinal()\n\nReturns whether the field is final.\n\n### isPrimitive()\n\n public boolean isPrimitive()\n\nReturns whether the field is primitive as defined by [Data#isPrimitive(Type)](/java/docs/reference/google-http-client/latest/com.google.api.client.util.Data#com_google_api_client_util_Data_isPrimitive_java_lang_reflect_Type_).\n\n### setValue(Object obj, Object value)\n\n public void setValue(Object obj, Object value)\n\nSets this field in the given object to the given value using reflection.\n\nIf the field is final, it checks that the value being set is identical to the existing\nvalue."]]