Class Misc
java.lang.Object
org.opencastproject.util.data.functions.Misc
Various functions not directly bound to any type.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <A,B> Function <A, B> cast()Cast from A to B.static <A,B> B Cast from A to B with special treatment of the Number classes.chuck()chuck(Throwable)as a function.static <A> AThrow a checked exception like a RuntimeException removing any needs to declare a throws clause.static <A> Function<A, A> ifThen(A predicate, A b) static <A> List<A> Widening cast.static <A> Optional<A> Widening cast.static <A> Option<A> Widening cast.
-
Method Details
-
chuck
Throw a checked exception like a RuntimeException removing any needs to declare a throws clause. This technique has been described by James Iry at http://james-iry.blogspot.de/2010/08/on-removing-java-checked-exceptions-by.html -
chuck
chuck(Throwable)as a function. -
cast
Cast from A to B with special treatment of the Number classes. -
cast
Cast from A to B. -
widen
Widening cast. -
widen
Widening cast. -
widen
Widening cast. -
ifThen
-