@GwtCompatible public final class CompactChecks extends Object
Check
class, allowing an even
more compact syntax.
To use it, statically import the check(Object)
method
and write your checks like this:
check(argument).check1().check2()...;
Examples:
check(name).matches("hello .*!").hasLenghtBetween(0, 20);
check(list).isNullOr().hasSize(0);
check(args).named("arguments").isNotEmpty();
Note: For intended use and thread safety issues, read the
documentation of the Check
class.
Modifier and Type | Method and Description |
---|---|
static PrimitiveArrayCheck |
check(boolean[] argument)
|
static PrimitiveArrayCheck |
check(byte[] argument)
|
static PrimitiveArrayCheck |
check(char[] argument)
|
static CollectionCheck |
check(Collection<?> argument)
|
static DoubleCheck |
check(double argument)
|
static PrimitiveArrayCheck |
check(double[] argument)
|
static PrimitiveArrayCheck |
check(float[] argument)
|
static IntCheck |
check(int argument)
See
Check.that(int) |
static PrimitiveArrayCheck |
check(int[] argument)
|
static LongCheck |
check(long argument)
See
Check.that(long) |
static PrimitiveArrayCheck |
check(long[] argument)
|
static NumberCheck |
check(Number argument)
|
static ObjectCheck |
check(Object argument)
|
static ObjectArrayCheck |
check(Object[] argument)
|
static PrimitiveArrayCheck |
check(short[] argument)
|
static StringCheck |
check(String argument)
|
static UrlCheck |
check(URL argument)
See
Check.that(URL) |
public static ObjectCheck check(Object argument)
public static StringCheck check(String argument)
public static ObjectArrayCheck check(Object[] argument)
public static PrimitiveArrayCheck check(boolean[] argument)
public static PrimitiveArrayCheck check(byte[] argument)
public static PrimitiveArrayCheck check(char[] argument)
public static PrimitiveArrayCheck check(double[] argument)
public static PrimitiveArrayCheck check(float[] argument)
public static PrimitiveArrayCheck check(int[] argument)
public static PrimitiveArrayCheck check(long[] argument)
public static PrimitiveArrayCheck check(short[] argument)
public static CollectionCheck check(Collection<?> argument)
public static NumberCheck check(Number argument)
@GwtIncompatible(value="java.net.URL") public static UrlCheck check(URL argument)
Check.that(URL)
public static IntCheck check(int argument)
Check.that(int)
public static LongCheck check(long argument)
Check.that(long)
public static DoubleCheck check(double argument)
Copyright © 2012–2017 Michael Faes. All rights reserved.