public abstract class Casts extends Object
| Constructor and Description |
|---|
Casts() |
| Modifier and Type | Method and Description |
|---|---|
static <R,T extends R> |
narrow(T value)
Performs an upcast on a value.
|
static <R,T extends R> |
narrower()
Creates a delegate performing a narrowing cast.
|
static <R,T> Delegate<R,T> |
variator()
Creates a delegate performing a reinterpret cast on a value.
|
static <R,T> R |
vary(T value)
Performs a reinterpret cast on a value.
|
static <R,T> R |
widen(T value)
Performs a downcast on a value.
|
static <T,R extends T> |
widener()
Creates a delegate performing a widening cast.
|
public static <R,T> R widen(T value)
R - the resulting typeT - the source typevalue - the value to be castpublic static <T,R extends T> Delegate<R,T> widener()
T - the resulting typeR - the source typepublic static <R,T extends R> R narrow(T value)
R - the resulting typeT - the source typevalue - the value to be castpublic static <R,T extends R> Delegate<R,T> narrower()
R - the resulting typeT - the source typepublic static <R,T> R vary(T value)
R - the resulting typeT - the source typevalue - the value to be castpublic static <R,T> Delegate<R,T> variator()
R - the resulting typeT - the source typeCopyright © 2016. All rights reserved.