Class ClassInfo
java.lang.Object
com.google.api.client.util.ClassInfo
Computes class information to determine data key name/value pairs associated with the class.
Implementation is thread-safe.
- Since:
- 1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ConcurrentMap<Class<?>, ClassInfo> Class information cache, with case-sensitive field names.private static final ConcurrentMap<Class<?>, ClassInfo> Class information cache, with case-insensitive fields names.private final Class<?> Class.private final booleanWhether field names are case sensitive.Unmodifiable sorted (with any possiblenullmember first) list (without duplicates) ofFieldInfo.getName().private final IdentityHashMap<String, FieldInfo> Map fromFieldInfo.getName()to the field information. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the field for the givenFieldInfo.getName().getFieldInfo(String name) Returns the information for the givenFieldInfo.getName().Returns an unmodifiable collection of theFieldInfos for this class, without any guarantee of order.final booleanReturns whether field names are case sensitive.getNames()Returns an unmodifiable sorted set (with any possiblenullmember first) ofnames.Class<?> Returns the underlying class.booleanisEnum()Returns the underlying class is an enum.static ClassInfoReturns the class information for the given underlying class.static ClassInfoReturns the class information for the given underlying class.
-
Field Details
-
CACHE
Class information cache, with case-sensitive field names. -
CACHE_IGNORE_CASE
Class information cache, with case-insensitive fields names. -
clazz
Class. -
ignoreCase
private final boolean ignoreCaseWhether field names are case sensitive. -
nameToFieldInfoMap
Map fromFieldInfo.getName()to the field information. -
names
Unmodifiable sorted (with any possiblenullmember first) list (without duplicates) ofFieldInfo.getName().
-
-
Constructor Details
-
ClassInfo
-
-
Method Details
-
of
-
of
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
-
getIgnoreCase
public final boolean getIgnoreCase()Returns whether field names are case sensitive.- Since:
- 1.10
-
getFieldInfo
Returns the information for the givenFieldInfo.getName().- Parameters:
name-FieldInfo.getName()ornull- Returns:
- field information or
nullfor none
-
getField
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
Returns an unmodifiable sorted set (with any possiblenullmember first) ofnames. -
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
-