Package com.google.api.client.util
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 boolean
Whether field names are case sensitive.Unmodifiable sorted (with any possiblenull
member 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 theFieldInfo
s for this class, without any guarantee of order.final boolean
Returns whether field names are case sensitive.getNames()
Returns an unmodifiable sorted set (with any possiblenull
member first) ofnames
.Class
<?> Returns the underlying class.boolean
isEnum()
Returns the underlying class is an enum.static ClassInfo
Returns the class information for the given underlying class.static ClassInfo
Returns 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 possiblenull
member first) list (without duplicates) ofFieldInfo.getName()
.
-
-
Constructor Details
-
ClassInfo
-
-
Method Details
-
of
Returns the class information for the given underlying class.- Parameters:
underlyingClass
- underlying class ornull
fornull
result- Returns:
- class information or
null
fornull
input
-
of
Returns the class information for the given underlying class.- Parameters:
underlyingClass
- underlying class ornull
fornull
resultignoreCase
- whether field names are case sensitive- Returns:
- class information or
null
fornull
input - Since:
- 1.10
-
getUnderlyingClass
Returns the underlying class.- Since:
- 1.4
-
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
null
for none
-
getField
Returns the field for the givenFieldInfo.getName()
.- Parameters:
name
-FieldInfo.getName()
ornull
- Returns:
- field or
null
for none
-
isEnum
public boolean isEnum()Returns the underlying class is an enum.- Since:
- 1.4
-
getNames
Returns an unmodifiable sorted set (with any possiblenull
member first) ofnames
. -
getFieldInfos
Returns an unmodifiable collection of theFieldInfo
s for this class, without any guarantee of order.If you need sorted order, instead use
getNames()
withgetFieldInfo(String)
.- Since:
- 1.16
-