public final class ConstValue extends AbstractValue
Value
.Constructor and Description |
---|
ConstValue(Object value)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Object |
get(ParseSession session)
Evaluate this value within the given context.
|
Class<?> |
getType(ParseSession session)
Get the type of this value without evaluating it.
|
int |
hashCode() |
String |
toString() |
add, and, asLValue, checkBoolean, checkIntegral, checkNotNull, checkNumeric, checkType, compare, divide, invert, lshift, mod, multiply, negate, or, rshift, subtract, urshift, xor, xxcrement
public ConstValue(Object value)
value
- constant result of evaluating this valuepublic Object get(ParseSession session)
Value
Normally this method should only be invoked once, and the result cached, because evaluation could have side effects.
session
- parse sessionpublic Class<?> getType(ParseSession session)
Value
This should perform a best-effort attempt to determine the type, but should not invoke get()
.
If the type is unknown, Object.class
should be returned.
getType
in interface Value
getType
in class AbstractValue
session
- parse sessionCopyright © 2022. All rights reserved.