public class Matchables
extends java.lang.Object
Constructor and Description |
---|
Matchables() |
Modifier and Type | Method and Description |
---|---|
static <T> Matchable.MXor<Queue<T>,Topic<T>> |
adapter(Adapter<T> adapter) |
static <T> Matchable.MXor<AnyMValue<T>,AnyMSeq<T>> |
anyM(AnyM<T> anyM) |
static Matchable.MatchableIterable<java.lang.Character> |
chars(java.lang.CharSequence seq) |
static Matchable.MTuple3<java.lang.Integer,java.lang.Integer,java.lang.Integer> |
dateDDMMYYYY(java.util.Date date) |
static Matchable.MTuple3<java.lang.Integer,java.lang.Integer,java.lang.Integer> |
dateHMS(java.util.Date date) |
static Matchable.MTuple3<java.lang.Integer,java.lang.Integer,java.lang.Integer> |
dateMMDDYYYY(java.util.Date date) |
static <T1> Matchable.MXor<T1,java.lang.Throwable> |
future(java.util.concurrent.CompletableFuture<T1> future) |
static <T1> Matchable.MXor<T1,java.lang.Throwable> |
future(FutureW<T1> future) |
static <T> Matchable.MTuple2<Maybe<T>,ListX<T>> |
headAndTail(java.util.Collection<T> col) |
static <K,V> ReactiveSeq<Matchable.MTuple2<K,V>> |
keysAndValues(java.util.Map<K,V> map) |
static Matchable.AutoCloseableMatchableIterable<java.lang.String> |
lines(java.io.BufferedReader in) |
static Matchable.AutoCloseableMatchableIterable<java.lang.String> |
lines(java.io.File f)
Pattern match on the contents of a File
|
static Matchable.AutoCloseableMatchableIterable<java.lang.String> |
lines(java.net.URL url) |
static Matchable.MTuple3<java.lang.Integer,java.lang.Integer,java.lang.Integer> |
localDateDDMMYYYY(java.time.LocalDate date) |
static Matchable.MTuple3<java.lang.Integer,java.lang.Integer,java.lang.Integer> |
localDateMMDDYYYY(java.time.LocalDate date) |
static Matchable.MTuple3<java.lang.Integer,java.lang.Integer,java.lang.Integer> |
localTimeHMS(java.time.LocalTime time) |
static <T> Matchable.MatchableOptional<T> |
maybe(Maybe<T> opt) |
static <T> Matchable.MatchableOptional<T> |
optional(java.util.Optional<T> opt) |
static <X extends java.lang.Throwable> |
throwable(X t) |
static <T1,X extends java.lang.Throwable> |
tryMatch(Try<T1,X> match) |
static Matchable.MTuple5<java.lang.String,java.lang.String,java.lang.Integer,java.lang.String,java.lang.String> |
url(java.net.URL url)
Break an URL down into
protocol, host, port, path, query
|
static Matchable.MatchableIterable<java.lang.String> |
words(java.lang.CharSequence seq) |
static <ST,PT> Matchable.MXor<ST,PT> |
xor(Xor<ST,PT> xor) |
public static <T> Matchable.MXor<Queue<T>,Topic<T>> adapter(Adapter<T> adapter)
public static <T1> Matchable.MXor<T1,java.lang.Throwable> future(java.util.concurrent.CompletableFuture<T1> future)
public static <T1> Matchable.MXor<T1,java.lang.Throwable> future(FutureW<T1> future)
public static <T1,X extends java.lang.Throwable> Matchable.MXor<T1,X> tryMatch(Try<T1,X> match)
public static <T> Matchable.MatchableOptional<T> maybe(Maybe<T> opt)
public static <T> Matchable.MatchableOptional<T> optional(java.util.Optional<T> opt)
public static <T> Matchable.MXor<AnyMValue<T>,AnyMSeq<T>> anyM(AnyM<T> anyM)
public static <X extends java.lang.Throwable> Matchable.MTuple4<java.lang.Class,java.lang.String,java.lang.Throwable,Matchable.MatchableIterable<java.lang.StackTraceElement>> throwable(X t)
public static Matchable.MTuple5<java.lang.String,java.lang.String,java.lang.Integer,java.lang.String,java.lang.String> url(java.net.URL url)
url
- public static Matchable.AutoCloseableMatchableIterable<java.lang.String> lines(java.io.BufferedReader in)
public static Matchable.AutoCloseableMatchableIterable<java.lang.String> lines(java.net.URL url)
public static Matchable.AutoCloseableMatchableIterable<java.lang.String> lines(java.io.File f)
String result = Matchables.lines(new File(file))
.on$12___()
.matches(c->c.is(when("hello","world"),then("correct")), otherwise("miss")).get();
f
- File to match againstpublic static Matchable.MatchableIterable<java.lang.String> words(java.lang.CharSequence seq)
public static Matchable.MatchableIterable<java.lang.Character> chars(java.lang.CharSequence seq)
public static <ST,PT> Matchable.MXor<ST,PT> xor(Xor<ST,PT> xor)
public static <T> Matchable.MTuple2<Maybe<T>,ListX<T>> headAndTail(java.util.Collection<T> col)
public static <K,V> ReactiveSeq<Matchable.MTuple2<K,V>> keysAndValues(java.util.Map<K,V> map)
public static Matchable.MTuple3<java.lang.Integer,java.lang.Integer,java.lang.Integer> dateDDMMYYYY(java.util.Date date)
public static Matchable.MTuple3<java.lang.Integer,java.lang.Integer,java.lang.Integer> dateMMDDYYYY(java.util.Date date)
public static Matchable.MTuple3<java.lang.Integer,java.lang.Integer,java.lang.Integer> localDateDDMMYYYY(java.time.LocalDate date)
public static Matchable.MTuple3<java.lang.Integer,java.lang.Integer,java.lang.Integer> localDateMMDDYYYY(java.time.LocalDate date)
public static Matchable.MTuple3<java.lang.Integer,java.lang.Integer,java.lang.Integer> dateHMS(java.util.Date date)
public static Matchable.MTuple3<java.lang.Integer,java.lang.Integer,java.lang.Integer> localTimeHMS(java.time.LocalTime time)