public final class ClassInfo extends Object
Implementation is thread-safe.
Modifier and Type | Method and Description |
---|---|
Field |
getField(String name)
Returns the field for the given
FieldInfo.getName() . |
FieldInfo |
getFieldInfo(String name)
Returns the information for the given
FieldInfo.getName() . |
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.
|
Collection<String> |
getNames()
Returns an unmodifiable sorted set (with any possible
null member first) of names . |
Class<?> |
getUnderlyingClass()
Returns the underlying class.
|
boolean |
isEnum()
Returns the underlying class is an enum.
|
static ClassInfo |
of(Class<?> underlyingClass)
Returns the class information for the given underlying class.
|
static ClassInfo |
of(Class<?> underlyingClass,
boolean ignoreCase)
Returns the class information for the given underlying class.
|
public static ClassInfo of(Class<?> underlyingClass)
underlyingClass
- underlying class or null
for null
resultnull
for null
inputpublic static ClassInfo of(Class<?> underlyingClass, boolean ignoreCase)
underlyingClass
- underlying class or null
for null
resultignoreCase
- whether field names are case sensitivenull
for null
inputpublic Class<?> getUnderlyingClass()
public final boolean getIgnoreCase()
public FieldInfo getFieldInfo(String name)
FieldInfo.getName()
.name
- FieldInfo.getName()
or null
null
for nonepublic Field getField(String name)
FieldInfo.getName()
.name
- FieldInfo.getName()
or null
null
for nonepublic boolean isEnum()
public Collection<String> getNames()
null
member first) of names
.public 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–2021 Google. All rights reserved.