public final class ClassInfo
extends java.lang.Object
Implementation is thread-safe.
Modifier and Type | Method and Description |
---|---|
java.lang.reflect.Field |
getField(java.lang.String name)
Returns the field for the given
FieldInfo.getName() . |
FieldInfo |
getFieldInfo(java.lang.String name)
Returns the information for the given
FieldInfo.getName() . |
java.util.Collection<FieldInfo> |
getFieldInfos()
Returns an unmodifiable collection of the
FieldInfo s for this class, without any
guarantee of order. |
boolean |
getIgnoreCase()
Returns whether field names are case sensitive.
|
java.util.Collection<java.lang.String> |
getNames()
Returns an unmodifiable sorted set (with any possible
null member first) of
names . |
java.lang.Class<?> |
getUnderlyingClass()
Returns the underlying class.
|
boolean |
isEnum()
Returns the underlying class is an enum.
|
static ClassInfo |
of(java.lang.Class<?> underlyingClass)
Returns the class information for the given underlying class.
|
static ClassInfo |
of(java.lang.Class<?> underlyingClass,
boolean ignoreCase)
Returns the class information for the given underlying class.
|
public static ClassInfo of(java.lang.Class<?> underlyingClass)
underlyingClass
- underlying class or null
for null
resultnull
for null
inputpublic static ClassInfo of(java.lang.Class<?> underlyingClass, boolean ignoreCase)
underlyingClass
- underlying class or null
for null
resultignoreCase
- whether field names are case sensitivenull
for null
inputpublic java.lang.Class<?> getUnderlyingClass()
public final boolean getIgnoreCase()
public FieldInfo getFieldInfo(java.lang.String name)
FieldInfo.getName()
.name
- FieldInfo.getName()
or null
null
for nonepublic java.lang.reflect.Field getField(java.lang.String name)
FieldInfo.getName()
.name
- FieldInfo.getName()
or null
null
for nonepublic boolean isEnum()
public java.util.Collection<java.lang.String> getNames()
null
member first) of
names
.public java.util.Collection<FieldInfo> getFieldInfos()
FieldInfo
s for this class, without any
guarantee of order.
If you need sorted order, instead use getNames()
with getFieldInfo(String)
.
Copyright © 2011-2018 Google. All Rights Reserved.