sdk-common / com.tomtom.online.sdk.common.functional / StringPredicates

StringPredicates

class StringPredicates

A collection of predefined string related Predicate implementations.

Those are especially useful in cases of compiler method ambiguity errors caused by Java type erasure.

Functions

contains

static fun contains(charSequence: CharSequence): Predicate<String!>!

Returns a predicate checking if a String contains the given char sequence.

contentEquals

static fun contentEquals(charSequence: CharSequence): Predicate<String!>!

Returns a predicate checking if a String has content equal to the given CharSequence.

endsWith

static fun endsWith(suffix: String): Predicate<String!>!

Returns a predicate checking if a String ends with the given suffix.

equalsIgnoreCase

static fun equalsIgnoreCase(another: String): Predicate<String!>!

Returns a predicate checking if a String has content equal to the given String. The resulting predicate will not be case sensitive!

isEmpty

static fun isEmpty(): Predicate<String!>!

Returns a predicate checking if a String is empty.

startsWith

static fun startsWith(prefix: String): Predicate<String!>!

Returns a predicate checking if a String starts with the given prefix.