Class NumberPredicate
- java.lang.Object
-
- me.s3ns3iw00.jcommands.argument.validator.type.NumberPredicate
-
- All Implemented Interfaces:
ArgumentPredicate<java.lang.Long>
public class NumberPredicate extends java.lang.Object implements ArgumentPredicate<java.lang.Long>
AnArgumentPredicate
that can be used on arguments withLong
input type
It validates the input with an inclusive range
-
-
Constructor Summary
Constructors Constructor Description NumberPredicate(long min, long max)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.function.Predicate<java.lang.Long>
getPredicate()
static NumberPredicate
greaterThan(long max)
Constructs the validation with only a maximumstatic NumberPredicate
lessThan(long min)
Constructs the validation with only a minimumstatic NumberPredicate
notInRage(long min, long max)
Constructs the validation with a range
-
-
-
Method Detail
-
getPredicate
public java.util.function.Predicate<java.lang.Long> getPredicate()
- Specified by:
getPredicate
in interfaceArgumentPredicate<java.lang.Long>
-
lessThan
public static NumberPredicate lessThan(long min)
Constructs the validation with only a minimum- Parameters:
min
- the minimum- Returns:
- the
NumberPredicate
-
greaterThan
public static NumberPredicate greaterThan(long max)
Constructs the validation with only a maximum- Parameters:
max
- the maximum- Returns:
- the
NumberPredicate
-
notInRage
public static NumberPredicate notInRage(long min, long max)
Constructs the validation with a range- Parameters:
min
- the minimummax
- the maximum- Returns:
- the
NumberPredicate
-
-