Package org.apache.lucene.util
Class StringHelper
java.lang.Object
org.apache.lucene.util.StringHelper
Methods for manipulating strings.
-
Method Summary
Modifier and TypeMethodDescriptionstatic intbytesDifference(BytesRef left, BytesRef right) Compares twoBytesRef, element by element, and returns the number of elements common to both arrays.static booleanReturnstrueiff the ref ends with the given suffix.static booleanstatic Comparator<String>static booleanstartsWith(BytesRef ref, BytesRef prefix) Returnstrueiff the ref starts with the given prefix.
-
Method Details
-
bytesDifference
Compares twoBytesRef, element by element, and returns the number of elements common to both arrays. -
getVersionComparator
- Returns:
- a Comparator over versioned strings such as X.YY.Z
-
equals
-
startsWith
Returnstrueiff the ref starts with the given prefix. Otherwisefalse.- Parameters:
ref- theBytesRefto testprefix- the expected prefix- Returns:
- Returns
trueiff the ref starts with the given prefix. Otherwisefalse.
-
endsWith
Returnstrueiff the ref ends with the given suffix. Otherwisefalse.- Parameters:
ref- theBytesRefto testsuffix- the expected suffix- Returns:
- Returns
trueiff the ref ends with the given suffix. Otherwisefalse.
-