IsLongerThan
See javadoc - uk.gov.gchq.koryphe.impl.predicate.IsLongerThan
Available since Koryphe version 1.3.0
Checks if the length of an input is more than a value
Examples
Test inputs
This will test whether each input has a size/length attribute greater than 5.
Java
JSON
Full JSON
Python
final IsLongerThan predicate = new IsLongerThan(5);
{
"class" : "IsLongerThan",
"minLength" : 5,
"orEqualTo" : false
}
{
"class" : "uk.gov.gchq.koryphe.impl.predicate.IsLongerThan",
"minLength" : 5,
"orEqualTo" : false
}
g.IsLongerThan(
min_length=5,
or_equal_to=False
)
Input type:
java.lang.Object
Example inputs:
Input Type | Input | Result |
---|---|---|
java.lang.String | testString | true |
java.lang.String | aTest | false |
[Ljava.lang.String; | [null, null, null, null, null] | false |
[Ljava.lang.String; | [null, null, null, null, null, null, null, null, null, null] | true |
java.util.Arrays$ArrayList | [0, 1, 2, 3, 4, 5] | true |
Test inputs with equal to set
This will test whether each input has a size/length attribute greater than, OR equal to 5.
Java
JSON
Full JSON
Python
final IsLongerThan predicate = new IsLongerThan(5, true);
{
"class" : "IsLongerThan",
"minLength" : 5,
"orEqualTo" : true
}
{
"class" : "uk.gov.gchq.koryphe.impl.predicate.IsLongerThan",
"minLength" : 5,
"orEqualTo" : true
}
g.IsLongerThan(
min_length=5,
or_equal_to=True
)
Input type:
java.lang.Object
Example inputs:
Input Type | Input | Result |
---|---|---|
java.lang.String | test | false |
java.lang.String | testString | true |
java.lang.String | aTest | true |
[Ljava.lang.String; | [null, null, null, null, null] | true |
[Ljava.lang.String; | [null, null, null, null, null, null, null, null, null, null] | true |
java.util.Arrays$ArrayList | [0, 1, 2, 3, 4, 5] | true |