public final class Term extends java.lang.Object implements java.lang.Comparable<Term>
Constructor and Description |
---|
Term(java.lang.String fld)
Constructs a Term with the given field and empty text.
|
Term(java.lang.String fld,
BytesRef bytes)
Constructs a Term with the given field and bytes.
|
Term(java.lang.String fld,
BytesRefBuilder bytesBuilder)
Constructs a Term with the given field and the bytes from a builder.
|
Term(java.lang.String fld,
java.lang.String text)
Constructs a Term with the given field and text.
|
Modifier and Type | Method and Description |
---|---|
BytesRef |
bytes()
Returns the bytes of this term, these should not be modified.
|
int |
compareTo(Term other)
Compares two terms, returning a negative integer if this
term belongs before the argument, zero if this term is equal to the
argument, and a positive integer if this term belongs after the argument.
|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
field()
Returns the field of this term.
|
int |
hashCode() |
java.lang.String |
text()
Returns the text of this term.
|
java.lang.String |
toString() |
static java.lang.String |
toString(BytesRef termText)
Returns human-readable form of the term text.
|
public Term(java.lang.String fld, BytesRef bytes)
Note that a null field or null bytes value results in undefined behavior for most Lucene APIs that accept a Term parameter.
The provided BytesRef is copied when it is non null.
public Term(java.lang.String fld, BytesRefBuilder bytesBuilder)
Note that a null field value results in undefined behavior for most Lucene APIs that accept a Term parameter.
public Term(java.lang.String fld, java.lang.String text)
Note that a null field or null text value results in undefined behavior for most Lucene APIs that accept a Term parameter.
public Term(java.lang.String fld)
fld
- field's namepublic final java.lang.String field()
public final java.lang.String text()
public static final java.lang.String toString(BytesRef termText)
public final BytesRef bytes()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public final int compareTo(Term other)
compareTo
in interface java.lang.Comparable<Term>
public final java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2000–2019 The Apache Software Foundation. All rights reserved.