Class Downcast<A extends B,B>
- java.lang.Object
-
- com.jnape.palatable.lambda.functions.builtin.fn1.Downcast<A,B>
-
- Type Parameters:
A
- the subtypeB
- the supertype
- All Implemented Interfaces:
Fn1<B,A>
,Applicative<A,Fn1<B,?>>
,Cartesian<B,A,Fn1<?,?>>
,Cocartesian<B,A,Fn1<?,?>>
,Contravariant<B,Profunctor<?,A,Fn1<?,?>>>
,Functor<A,Fn1<B,?>>
,Profunctor<B,A,Fn1<?,?>>
,Monad<A,Fn1<B,?>>
,MonadReader<B,A,Fn1<B,?>>
,MonadRec<A,Fn1<B,?>>
,MonadWriter<B,A,Fn1<B,?>>
public final class Downcast<A extends B,B> extends java.lang.Object implements Fn1<B,A>
Covariantly cast a value of typeB
to a value of subtypeA
. Unsafe.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
Downcast()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description A
checkedApply(B b)
Invoke this function with the given argument, potentially throwing anyThrowable
.static <A extends B,B>
Downcast<A,B>downcast()
static <A extends B,B>
Adowncast(B b)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Field Detail
-
INSTANCE
private static final Downcast<?,?> INSTANCE
-
-
Method Detail
-
checkedApply
public A checkedApply(B b)
Description copied from interface:Fn1
Invoke this function with the given argument, potentially throwing anyThrowable
.- Specified by:
checkedApply
in interfaceFn1<A extends B,B>
- Parameters:
b
- the argument- Returns:
- the result of the function application
-
downcast
public static <A extends B,B> Downcast<A,B> downcast()
-
downcast
public static <A extends B,B> A downcast(B b)
-
-