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