Package io.deephaven.api.object
Interface UnionObject
public interface UnionObject
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Equivalent toexpect(Boolean.class)
.byte
Equivalent tonumber().byteValue()
.char
Equivalent toexpect(Character.class)
.double
Equivalent tonumber().doubleValue()
.<T> T
Returns the object as typeT
if the unwrapped object is an instance ofclazz
.float
Equivalent tonumber().floatValue()
.static UnionObject
Ifx
is a boxed primitive, this will create the union object with the primitive value.int
intValue()
Equivalent tonumber().intValue()
.long
Equivalent tonumber().longValue()
.number()
Equivalent toexpect(Number.class)
.static UnionObject
of
(boolean x) static UnionObject
of
(byte x) static UnionObject
of
(char x) static UnionObject
of
(double x) static UnionObject
of
(float x) static UnionObject
of
(int x) static UnionObject
of
(long x) static UnionObject
of
(short x) static UnionObject
Create a wrapped object, must not be a boxed primitive type.short
Equivalent tonumber().shortValue()
.unwrap()
Unwraps the object or boxed primitive.<T> T
visit
(UnionObject.Visitor<T> visitor)
-
Method Details
-
of
-
of
-
of
-
of
-
of
-
of
-
of
-
of
-
of
Create a wrapped object, must not be a boxed primitive type. Usefrom(Object)
if you need boxed primitive support.- Parameters:
x
- the object- Returns:
- the union object
-
from
Ifx
is a boxed primitive, this will create the union object with the primitive value. Otherwise, this will create the object viaof(Object)
.- Parameters:
x
- the object- Returns:
- the union object
-
unwrap
Object unwrap()Unwraps the object or boxed primitive.- Returns:
- the object
-
expect
Returns the object as typeT
if the unwrapped object is an instance ofclazz
.- Type Parameters:
T
- the type- Parameters:
clazz
- the class- Returns:
- this object as type of clazz
- Throws:
IllegalArgumentException
- if the object is not an instance ofclazz
.
-
number
Equivalent toexpect(Number.class)
.- Returns:
- this object as a
Number
- Throws:
IllegalArgumentException
- if the object is not an instance ofNumber
.- See Also:
-
booleanValue
boolean booleanValue()Equivalent toexpect(Boolean.class)
.- Returns:
- this object as a boolean
- See Also:
-
charValue
char charValue()Equivalent toexpect(Character.class)
.- Returns:
- this object as a character
- See Also:
-
byteValue
byte byteValue()Equivalent tonumber().byteValue()
.- Returns:
- this object as a byte
- See Also:
-
shortValue
short shortValue()Equivalent tonumber().shortValue()
.- Returns:
- this object as a short
- See Also:
-
intValue
int intValue()Equivalent tonumber().intValue()
.- Returns:
- this object as an int
- See Also:
-
longValue
long longValue()Equivalent tonumber().longValue()
.- Returns:
- this object as a long
- See Also:
-
floatValue
float floatValue()Equivalent tonumber().floatValue()
.- Returns:
- this object as a float
- See Also:
-
doubleValue
double doubleValue()Equivalent tonumber().doubleValue()
.- Returns:
- this object as a double
- See Also:
-
visit
-