Package com.google.api.client.util
Class ClassInfo
- java.lang.Object
-
- com.google.api.client.util.ClassInfo
-
public final class ClassInfo extends Object
Computes class information to determine data key name/value pairs associated with the class.Implementation is thread-safe.
- Since:
- 1.0
- Author:
- Yaniv Inbar
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FieldgetField(String name)Returns the field for the givenFieldInfo.getName().FieldInfogetFieldInfo(String name)Returns the information for the givenFieldInfo.getName().Collection<FieldInfo>getFieldInfos()Returns an unmodifiable collection of theFieldInfos for this class, without any guarantee of order.booleangetIgnoreCase()Returns whether field names are case sensitive.Collection<String>getNames()Returns an unmodifiable sorted set (with any possiblenullmember first) ofnames.Class<?>getUnderlyingClass()Returns the underlying class.booleanisEnum()Returns the underlying class is an enum.static ClassInfoof(Class<?> underlyingClass)Returns the class information for the given underlying class.static ClassInfoof(Class<?> underlyingClass, boolean ignoreCase)Returns the class information for the given underlying class.
-
-
-
Method Detail
-
of
public static ClassInfo of(Class<?> underlyingClass)
Returns the class information for the given underlying class.- Parameters:
underlyingClass- underlying class ornullfornullresult- Returns:
- class information or
nullfornullinput
-
of
public static ClassInfo of(Class<?> underlyingClass, boolean ignoreCase)
Returns the class information for the given underlying class.- Parameters:
underlyingClass- underlying class ornullfornullresultignoreCase- whether field names are case sensitive- Returns:
- class information or
nullfornullinput - Since:
- 1.10
-
getUnderlyingClass
public Class<?> getUnderlyingClass()
Returns the underlying class.- Since:
- 1.4
-
getIgnoreCase
public final boolean getIgnoreCase()
Returns whether field names are case sensitive.- Since:
- 1.10
-
getFieldInfo
public FieldInfo getFieldInfo(String name)
Returns the information for the givenFieldInfo.getName().- Parameters:
name-FieldInfo.getName()ornull- Returns:
- field information or
nullfor none
-
getField
public Field getField(String name)
Returns the field for the givenFieldInfo.getName().- Parameters:
name-FieldInfo.getName()ornull- Returns:
- field or
nullfor none
-
isEnum
public boolean isEnum()
Returns the underlying class is an enum.- Since:
- 1.4
-
getNames
public Collection<String> getNames()
Returns an unmodifiable sorted set (with any possiblenullmember first) ofnames.
-
getFieldInfos
public Collection<FieldInfo> getFieldInfos()
Returns an unmodifiable collection of theFieldInfos for this class, without any guarantee of order.If you need sorted order, instead use
getNames()withgetFieldInfo(String).- Since:
- 1.16
-
-