T - the type of the first argument to the converterU - the type of the second argument to the converterR - the type of the result of the converter@ParametersAreNonnullByDefault public interface BiConverter<T,U,R> extends BiFunction<T,U,R>
BiFunction that converts an object of type T to another of type R, by using an
object of type U.
The reverse operation may be strict inverse, meaning that converter.revert(converter.convert(a,
c), c).equals(a) always true.
BiFunction| Modifier and Type | Method and Description |
|---|---|
default R |
apply(T t,
U u) |
R |
convert(T t,
U u)
Returns a representation of
t as an instance of type R, by using an object of type U. |
static <T,U,R> BiConverter<T,U,R> |
from(BiFunction<? super T,? super U,? extends R> convertFunc,
BiFunction<? super R,? super U,? extends T> revertFunc)
Creates a bi-converter based on separate forward and backward functions.
|
static <T,U> BiConverter<T,U,T> |
identity()
Creates a bi-converter that always converts or reverses an object to itself.
|
default BiConverter<R,U,T> |
reverse()
Returns the reversed converter of this converter.
|
T |
revert(R r,
U u)
Returns a representation of
r as an instance of type T, by using an object of type U. |
andThen@Nonnull static <T,U> BiConverter<T,U,T> identity()
T - the type of the converted instance and the result@Nonnull static <T,U,R> BiConverter<T,U,R> from(BiFunction<? super T,? super U,? extends R> convertFunc, BiFunction<? super R,? super U,? extends T> revertFunc)
T - the type of the first argument to the converterU - the type of the second argument to the converterR - the type of the result of the converterconvertFunc - the function used for convert(Object, Object)revertFunc - the function used for revert(Object, Object)R convert(T t, U u)
t as an instance of type R, by using an object of type U.t - the instance to convertu - the helper instanceT revert(R r, U u)
r as an instance of type T, by using an object of type U.r - the instance to convertu - the helper instance@Nonnull default BiConverter<R,U,T> reverse()
Copyright © 2017–2019 Atlanmod. All rights reserved.