Package org.apache.lucene.util
Class StringHelper
java.lang.Object
org.apache.lucene.util.StringHelper
Methods for manipulating strings.
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
bytesDifference
(BytesRef left, BytesRef right) Compares twoBytesRef
, element by element, and returns the number of elements common to both arrays.static boolean
Returnstrue
iff the ref ends with the given suffix.static boolean
static Comparator<String>
static boolean
startsWith
(BytesRef ref, BytesRef prefix) Returnstrue
iff 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
Returnstrue
iff the ref starts with the given prefix. Otherwisefalse
.- Parameters:
ref
- theBytesRef
to testprefix
- the expected prefix- Returns:
- Returns
true
iff the ref starts with the given prefix. Otherwisefalse
.
-
endsWith
Returnstrue
iff the ref ends with the given suffix. Otherwisefalse
.- Parameters:
ref
- theBytesRef
to testsuffix
- the expected suffix- Returns:
- Returns
true
iff the ref ends with the given suffix. Otherwisefalse
.
-