Package org.apache.lucene.util
Class StringHelper
- java.lang.Object
-
- org.apache.lucene.util.StringHelper
-
public abstract class StringHelper extends Object
Methods for manipulating strings.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
bytesDifference(BytesRef left, BytesRef right)
Compares twoBytesRef
, element by element, and returns the number of elements common to both arrays.static boolean
endsWith(BytesRef ref, BytesRef suffix)
Returnstrue
iff the ref ends with the given suffix.static boolean
equals(String s1, String s2)
static Comparator<String>
getVersionComparator()
static boolean
startsWith(BytesRef ref, BytesRef prefix)
Returnstrue
iff the ref starts with the given prefix.
-
-
-
Method Detail
-
bytesDifference
public static int bytesDifference(BytesRef left, BytesRef right)
Compares twoBytesRef
, element by element, and returns the number of elements common to both arrays.
-
getVersionComparator
public static Comparator<String> getVersionComparator()
- Returns:
- a Comparator over versioned strings such as X.YY.Z
-
startsWith
public static boolean startsWith(BytesRef ref, BytesRef prefix)
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
.
-
-