| Modifier and Type | Class and Description |
|---|---|
static class |
Union.A2<P1,P2> |
static class |
Union.A3<P1,P2,P3> |
static class |
Union.A4<P1,P2,P3,P4> |
static class |
Union.A5<P1,P2,P3,P4,P5> |
Objs.Constructor<T extends Objs>, Objs.Property<T>| Modifier and Type | Method and Description |
|---|---|
static Union |
$as(Object value)
Creates a generic union with value, but no known types.
|
static <A,B> Union.A2<A,B> |
$as(Object value,
Class<A> a,
Class<B> b)
Creates an union for provided value and list of known types.
|
static <A,B,C> Union.A3<A,B,C> |
$as(Object value,
Class<A> a,
Class<B> b,
Class<C> c)
Creates an union for provided value and list of known types.
|
static <A,B,C,D> Union.A4<A,B,C,D> |
$as(Object value,
Class<A> a,
Class<B> b,
Class<C> c,
Class<D> d)
Creates an union for provided value and list of known types.
|
static <A,B,C,D,E> |
$as(Object value,
Class<A> a,
Class<B> b,
Class<C> c,
Class<D> d,
Class<E> e)
Creates an union for provided value and list of known types.
|
abstract <T> T |
cast(Class<T> type)
Casts the value in this union to requested type.
|
abstract boolean |
instanceOf(Class<?> type)
Checks if the current value can be casted to instance of given type.
|
$as, $cast, $delete, $get, $js, $set, create, create, defineProperties, defineProperty, freeze, getOwnPropertyDescriptor, getOwnPropertyNames, getPrototypeOf, hasOwnProperty, isExtensible, isFrozen, isPrototypeOf, isSealed, keys, newObject, newObject, preventExtensions, propertyIsEnumerable, seal, toLocaleString, toString, valueOfpublic abstract <T> T cast(Class<T> type)
T - the requested typetype - class of the requested typeClassCastException - if the value cannot be castpublic abstract boolean instanceOf(Class<?> type)
type - the class to assign the value totrue, if it can be casted, false otherwisepublic static Union $as(Object value)
value - value for the unionobj objectpublic static <A,B> Union.A2<A,B> $as(Object value, Class<A> a, Class<B> b)
A - type aB - type bvalue - the actual value of the uniona - class ab - class bpublic static <A,B,C> Union.A3<A,B,C> $as(Object value, Class<A> a, Class<B> b, Class<C> c)
A - type aB - type bC - type cvalue - the actual value of the uniona - class ab - class bc - class cpublic static <A,B,C,D> Union.A4<A,B,C,D> $as(Object value, Class<A> a, Class<B> b, Class<C> c, Class<D> d)
A - type aB - type bC - type cD - type dvalue - the actual value of the uniona - class ab - class bc - class cd - class dpublic static <A,B,C,D,E> Union.A5<A,B,C,D,E> $as(Object value, Class<A> a, Class<B> b, Class<C> c, Class<D> d, Class<E> e)
A - type aB - type bC - type cD - type dE - type dvalue - the actual value of the uniona - class ab - class bc - class cd - class de - class eCopyright © 2018. All rights reserved.