public class SnippetObjectConstant extends Object
| Constructor and Description |
|---|
SnippetObjectConstant(Object object) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
asBoolean() |
Object |
asBoxedPrimitive() |
double |
asDouble() |
float |
asFloat() |
int |
asInt() |
long |
asLong() |
<T> T |
asObject(Class<T> type)
Gets the object represented by this constant if it is of the given type.
|
boolean |
equals(Object o) |
JavaKind |
getJavaKind() |
int |
hashCode() |
boolean |
isDefaultForKind() |
boolean |
isNull() |
String |
toString() |
String |
toValueString() |
protected final Object object
public SnippetObjectConstant(Object object)
public JavaKind getJavaKind()
public <T> T asObject(Class<T> type)
type - the expected type of the object represented by this constant. If the object is
required to be of this type, then wrap the call to this method in
Objects.requireNonNull(Object).instance of type otherwise
nullpublic String toValueString()
public boolean isNull()
public boolean isDefaultForKind()
public Object asBoxedPrimitive()
public int asInt()
public boolean asBoolean()
public long asLong()
public float asFloat()
public double asDouble()