public final class JsSpecs extends Object
Modifier and Type | Field and Description |
---|---|
static JsSpec |
FALSE
false constant spec
|
static JsSpec |
TRUE
true constant spec
|
Modifier and Type | Method and Description |
---|---|
static JsSpec |
any()
spec that is conformed by any value
|
static JsSpec |
any(Predicate<JsValue> predicate)
returns a spec that conforms any value that is evaluated to true on the predicate.
|
static JsArraySpec |
array()
non-nullable array spec
|
static JsArraySpec |
array(Predicate<JsValue> predicate)
non-nullable array, where each element of the array satisfies the given predicate
|
static JsArraySpec |
arrayOfBigInt()
non-nullable array of integral numbers spec
|
static JsArraySpec |
arrayOfBigInt(int minLength,
int maxLength) |
static JsArraySpec |
arrayOfBigInt(Predicate<BigInteger> predicate)
non-nullable array of integral numbers, where each element of the array satisfies
the given predicate
|
static JsArraySpec |
arrayOfBigInt(Predicate<BigInteger> predicate,
int minLength,
int maxLength)
non-nullable array of integral numbers, where each element of the array satisfies
the given predicate
|
static JsArraySpec |
arrayOfBigIntSuchThat(Predicate<JsArray> predicate)
non-nullable array of integral numbers that satisfies the given predicate
|
static JsArraySpec |
arrayOfBool()
non-nullable array of booleans spec
|
static JsArraySpec |
arrayOfBool(int minLength,
int maxLength) |
static JsArraySpec |
arrayOfBoolSuchThat(Predicate<JsArray> predicate)
non-nullable array of booleans that satisfies the given predicate
|
static JsArraySpec |
arrayOfDec()
non-nullable array of decimal numbers spec
|
static JsArraySpec |
arrayOfDec(int minLength,
int maxLength) |
static JsArraySpec |
arrayOfDec(Predicate<BigDecimal> predicate)
non-nullable array of decimal numbers, where each element of the array satisfies
the given predicate
|
static JsArraySpec |
arrayOfDec(Predicate<BigDecimal> predicate,
int minLength,
int maxLength)
non-nullable array of decimal numbers, where each element of the array satisfies
the given predicate
|
static JsArraySpec |
arrayOfDecSuchThat(Predicate<JsArray> predicate)
non-nullable array of decimal numbers that satisfies the given predicate
|
static JsArraySpec |
arrayOfInt()
non-nullable array of integer numbers spec
|
static JsArraySpec |
arrayOfInt(int minLength,
int maxLength) |
static JsArraySpec |
arrayOfInt(IntPredicate predicate)
non-nullable array of integer numbers, where each element of the array satisfies the given predicate
|
static JsArraySpec |
arrayOfInt(IntPredicate predicate,
int minLength,
int maxLength)
non-nullable array of integer numbers, where each element of the array satisfies the given predicate
|
static JsArraySpec |
arrayOfIntSuchThat(Predicate<JsArray> predicate)
non-nullable array of numbers that satisfies the given predicate
|
static JsArraySpec |
arrayOfLong()
non-nullable array of long numbers spec
|
static JsArraySpec |
arrayOfLong(int minLength,
int maxLength) |
static JsArraySpec |
arrayOfLong(LongPredicate predicate)
non-nullable array of long numbers, where each element of the array satisfies the given predicate
|
static JsArraySpec |
arrayOfLong(LongPredicate predicate,
int minLength,
int maxLength)
non-nullable array of long numbers, where each element of the array satisfies the given predicate
|
static JsArraySpec |
arrayOfLongSuchThat(Predicate<JsArray> predicate)
non-nullable array of long numbers that satisfies the given predicate
|
static JsArraySpec |
arrayOfNumber()
non-nullable array of numbers spec
|
static JsArraySpec |
arrayOfNumber(int minLength,
int maxLength) |
static JsArraySpec |
arrayOfNumber(Predicate<JsNumber> predicate)
non-nullable array of numbers, where each element of the array satisfies
the given predicate
|
static JsArraySpec |
arrayOfNumber(Predicate<JsNumber> predicate,
int minLength,
int maxLength)
non-nullable array of numbers, where each element of the array satisfies
the given predicate
|
static JsArraySpec |
arrayOfNumberSuchThat(Predicate<JsArray> predicate)
non-nullable array of numbers that satisfies the given predicate
|
static JsArraySpec |
arrayOfObj()
non-nullable array of objects spec
|
static JsArraySpec |
arrayOfObj(int minLength,
int maxLength) |
static JsArraySpec |
arrayOfObj(Predicate<JsObj> predicate)
non-nullable array of objects, where each element of the array satisfies
the given predicate
|
static JsArraySpec |
arrayOfObj(Predicate<JsObj> predicate,
int minLength,
int maxLength)
non-nullable array of objects, where each element of the array satisfies
the given predicate
|
static JsArraySpec |
arrayOfObjSpec(JsObjSpec spec)
A required and none nullable spec that specifies an array of objects that conform the given spec
|
static JsArraySpec |
arrayOfObjSpec(JsObjSpec spec,
int minLength,
int maxLength)
A required and none nullable spec that specifies an array of objects that conform the given spec
|
static JsArraySpec |
arrayOfObjSuchThat(Predicate<JsArray> predicate)
non-nullable array of objects that satisfies the given predicate
|
static JsArraySpec |
arrayOfStr()
non-nullable array of strings spec
|
static JsArraySpec |
arrayOfStr(int minLength,
int maxLength) |
static JsArraySpec |
arrayOfStr(Predicate<String> predicate)
non-nullable array of strings, where each element of the array satisfies the given predicate
|
static JsArraySpec |
arrayOfStr(Predicate<String> predicate,
int minLength,
int maxLength)
non-nullable array of strings, where each element of the array satisfies the given predicate
|
static JsArraySpec |
arrayOfStrSuchThat(Predicate<JsArray> predicate)
non-nullable array of strings that satisfies the given predicate
|
static JsArraySpec |
arraySuchThat(Predicate<JsArray> predicate)
non-nullable array that satisfies the given predicate
|
static JsSpec |
bigInteger()
non-nullable integral number
|
static JsSpec |
bigInteger(Predicate<BigInteger> predicate)
non-nullable integral number that satisfies the given predicate
|
static JsSpec |
binary()
non-nullable array spec
|
static JsSpec |
binary(Predicate<byte[]> predicate)
non-nullable json object that satisfies the given predicate
|
static JsSpec |
bool()
non-nullable boolean
|
static JsSpec |
cons(JsValue value)
a required and non nullable spec that specifies a constant
|
static JsSpec |
decimal()
non-nullable decimal number
|
static JsSpec |
decimal(Predicate<BigDecimal> predicate)
non-nullable decimal number that satisfies the given predicate
|
static JsSpec |
instant()
non-nullable array spec
|
static JsSpec |
instant(Predicate<Instant> predicate)
non-nullable json object that satisfies the given predicate
|
static JsSpec |
integer()
non-nullable integer number
|
static JsSpec |
integer(IntPredicate predicate)
non-nullable integer number that satisfies the given predicate
|
static JsSpec |
longInteger()
non-nullable long number
|
static JsSpec |
longInteger(LongPredicate predicate)
non-nullable long number that satisfies the given predicate
|
static JsSpec |
number()
non-nullable number
|
static JsSpec |
number(Predicate<JsNumber> predicate)
non-nullable number that satisfies the given predicate
|
static JsSpec |
obj()
non-nullable json object spec
|
static JsSpec |
obj(Predicate<JsObj> predicate)
non-nullable json object that satisfies the given predicate
|
static <O extends JsValue> |
oneOf(List<O> cons)
returns an enum spec
|
static JsSpec |
str()
non-nullable string
|
static JsSpec |
str(Predicate<String> predicate)
non-nullable string that satisfies the given predicate
|
static JsTupleSpec |
tuple(JsSpec spec,
JsSpec... others)
returns a tuple spec.
|
public static final JsSpec TRUE
public static final JsSpec FALSE
public static JsArraySpec arrayOfNumber()
public static JsArraySpec arrayOfDec()
public static JsArraySpec arrayOfBigInt()
public static JsArraySpec arrayOfObj()
public static JsArraySpec arrayOfBool()
public static JsSpec instant()
public static JsArraySpec arrayOfLong()
public static JsArraySpec arrayOfInt()
public static JsArraySpec arrayOfStr()
public static JsSpec binary()
public static JsSpec bigInteger()
public static JsSpec longInteger()
public static JsSpec bool()
public static JsSpec decimal()
public static JsSpec integer()
public static JsSpec obj()
public static JsArraySpec array()
public static JsSpec any()
public static JsSpec str()
public static JsSpec number()
public static JsArraySpec arrayOfInt(int minLength, int maxLength)
minLength
- minimum length of the array (inclusive)maxLength
- maximum length of the array (inclusive)public static JsArraySpec arrayOfBigInt(int minLength, int maxLength)
minLength
- minimum length of the array (inclusive)maxLength
- maximum length of the array (inclusive)public static JsArraySpec arrayOfNumber(int minLength, int maxLength)
minLength
- minimum length of the array (inclusive)maxLength
- maximum length of the array (inclusive)public static JsArraySpec arrayOfObj(int minLength, int maxLength)
minLength
- minimum length of the array (inclusive)maxLength
- maximum length of the array (inclusive)public static JsArraySpec arrayOfDec(int minLength, int maxLength)
minLength
- minimum length of the array (inclusive)maxLength
- maximum length of the array (inclusive)public static JsArraySpec arrayOfBool(int minLength, int maxLength)
minLength
- minimum length of the array (inclusive)maxLength
- maximum length of the array (inclusive)public static JsArraySpec arrayOfStr(int minLength, int maxLength)
minLength
- minimum length of the array (inclusive)maxLength
- maximum length of the array (inclusive)public static JsArraySpec arrayOfLong(int minLength, int maxLength)
minLength
- minimum length of the array (inclusive)maxLength
- maximum length of the array (inclusive)public static JsArraySpec arrayOfObjSpec(JsObjSpec spec)
spec
- the given spec that every object in the array has to conformpublic static JsArraySpec arrayOfObjSpec(JsObjSpec spec, int minLength, int maxLength)
spec
- the given spec that every object in the array has to conformminLength
- minimum length of the array (inclusive)maxLength
- maximum length of the array (inclusive)public static JsSpec cons(JsValue value)
value
- the constantpublic static JsSpec str(Predicate<String> predicate)
predicate
- the predicatepublic static JsSpec number(Predicate<JsNumber> predicate)
predicate
- the predicatepublic static JsArraySpec arrayOfIntSuchThat(Predicate<JsArray> predicate)
predicate
- the predicate the array is tested onpublic static JsArraySpec arrayOfDec(Predicate<BigDecimal> predicate)
predicate
- the predicate each decimal number of the array is tested onpublic static JsArraySpec arrayOfDec(Predicate<BigDecimal> predicate, int minLength, int maxLength)
predicate
- the predicate each decimal number of the array is tested onminLength
- the minimum size of the array (inclusive)maxLength
- the maximum size of the array (inclusive)public static JsArraySpec arrayOfDecSuchThat(Predicate<JsArray> predicate)
predicate
- the predicate the array is tested onpublic static JsArraySpec arrayOfBigInt(Predicate<BigInteger> predicate)
predicate
- the predicate each integral number of the array is tested onpublic static JsArraySpec arrayOfBigInt(Predicate<BigInteger> predicate, int minLength, int maxLength)
predicate
- the predicate each integral number of the array is tested onminLength
- the minimum size of the array (inclusive)maxLength
- the maximum size of the array (inclusive)public static JsArraySpec arrayOfBigIntSuchThat(Predicate<JsArray> predicate)
predicate
- the predicate the array is tested onpublic static JsArraySpec arrayOfNumber(Predicate<JsNumber> predicate)
predicate
- the predicate each number of the array is tested onpublic static JsArraySpec arrayOfNumber(Predicate<JsNumber> predicate, int minLength, int maxLength)
predicate
- the predicate each number of the array is tested onminLength
- the minimum size of the array (inclusive)maxLength
- the maximum size of the array (inclusive)public static JsArraySpec arrayOfNumberSuchThat(Predicate<JsArray> predicate)
predicate
- the predicate the array is tested onpublic static JsArraySpec arrayOfObj(Predicate<JsObj> predicate)
predicate
- the predicate each object of the array is tested onpublic static JsArraySpec arrayOfObj(Predicate<JsObj> predicate, int minLength, int maxLength)
predicate
- the predicate each object of the array is tested onminLength
- the minimum size of the array (inclusive)maxLength
- the maximum size of the array (inclusive)public static JsArraySpec arrayOfObjSuchThat(Predicate<JsArray> predicate)
predicate
- the predicate the array is tested onpublic static JsSpec integer(IntPredicate predicate)
predicate
- the predicate the integer is tested onpublic static JsArraySpec arrayOfStrSuchThat(Predicate<JsArray> predicate)
predicate
- the predicate the array is tested onpublic static JsArraySpec array(Predicate<JsValue> predicate)
predicate
- the predicate each value of the array is tested onpublic static JsArraySpec arrayOfLong(LongPredicate predicate)
predicate
- the predicate each long number of the array is tested onpublic static JsArraySpec arrayOfLong(LongPredicate predicate, int minLength, int maxLength)
predicate
- the predicate each long number of the array is tested onminLength
- the minimum size of the array (inclusive)maxLength
- the maximum size of the array (inclusive)public static JsArraySpec arrayOfBoolSuchThat(Predicate<JsArray> predicate)
predicate
- the predicate the array is tested onpublic static JsSpec longInteger(LongPredicate predicate)
predicate
- the predicate the long is tested onpublic static JsSpec decimal(Predicate<BigDecimal> predicate)
predicate
- the predicate the decimal is tested onpublic static JsSpec bigInteger(Predicate<BigInteger> predicate)
predicate
- the predicate the integral number is tested onpublic static JsArraySpec arrayOfStr(Predicate<String> predicate)
predicate
- the predicate each string of the array is tested onpublic static JsArraySpec arrayOfStr(Predicate<String> predicate, int minLength, int maxLength)
predicate
- the predicate each string of the array is tested onminLength
- the minimum size of the array (inclusive)maxLength
- the maximum size of the array (inclusive)public static JsSpec any(Predicate<JsValue> predicate)
predicate
- the predicatepublic static JsSpec binary(Predicate<byte[]> predicate)
predicate
- the predicate the json object is tested onpublic static JsSpec instant(Predicate<Instant> predicate)
predicate
- the predicate the json object is tested onpublic static JsSpec obj(Predicate<JsObj> predicate)
predicate
- the predicate the json object is tested onpublic static JsArraySpec arrayOfLongSuchThat(Predicate<JsArray> predicate)
predicate
- the predicate the array is tested onpublic static JsArraySpec arraySuchThat(Predicate<JsArray> predicate)
predicate
- the predicate the array is tested onpublic static JsArraySpec arrayOfInt(IntPredicate predicate)
predicate
- the predicate each integer number of the array is tested onpublic static JsArraySpec arrayOfInt(IntPredicate predicate, int minLength, int maxLength)
predicate
- the predicate each integer number of the array is tested onminLength
- the minimum size of the array (inclusive)maxLength
- the maximum size of the array (inclusive)public static JsTupleSpec tuple(JsSpec spec, JsSpec... others)
spec
- the spec of the first elementothers
- the rest of specsCopyright © 2022. All rights reserved.