Package io.deephaven.api.object
Interface UnionObject
public interface UnionObject
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbooleanEquivalent toexpect(Boolean.class).byteEquivalent tonumber().byteValue().charEquivalent toexpect(Character.class).doubleEquivalent tonumber().doubleValue().<T> TReturns the object as typeTif the unwrapped object is an instance ofclazz.floatEquivalent tonumber().floatValue().static UnionObjectIfxis a boxed primitive, this will create the union object with the primitive value.intintValue()Equivalent tonumber().intValue().longEquivalent tonumber().longValue().number()Equivalent toexpect(Number.class).static UnionObjectof(boolean x) static UnionObjectof(byte x) static UnionObjectof(char x) static UnionObjectof(double x) static UnionObjectof(float x) static UnionObjectof(int x) static UnionObjectof(long x) static UnionObjectof(short x) static UnionObjectCreate a wrapped object, must not be a boxed primitive type.shortEquivalent tonumber().shortValue().unwrap()Unwraps the object or boxed primitive.<T> Tvisit(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
Ifxis 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 typeTif 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
-