Package org.apache.lucene.index
Record Class LeafMetaData
java.lang.Object
java.lang.Record
org.apache.lucene.index.LeafMetaData
- Record Components:
createdVersionMajor
- the Lucene version that created this index. This can be used to implement backward compatibility on top of the codec API. A return value of6
indicates that the created version is unknown.minVersion
- the minimum Lucene version that contributed documents to this index, ornull
if this information is not available.sort
- the order in which documents from this index are sorted, ornull
if documents are in no particular order.hasBlocks
- Returnstrue
iff this index contains blocks created withIndexWriter.addDocument(Iterable)
or it's corresponding update methods with at least 2 or more documents per call. Note: This property was not recorded beforeVersion.LUCENE_9_9_0
this method will return false for all leaves written beforeVersion.LUCENE_9_9_0
public record LeafMetaData(int createdVersionMajor, Version minVersion, Sort sort, boolean hasBlocks)
extends Record
Provides read-only metadata about a leaf.
- See Also:
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Constructor Summary
ConstructorsConstructorDescriptionLeafMetaData
(int createdVersionMajor, Version minVersion, Sort sort, boolean hasBlocks) Expert: Sole constructor. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the value of thecreatedVersionMajor
record component.final boolean
Indicates whether some other object is "equal to" this one.boolean
Returns the value of thehasBlocks
record component.final int
hashCode()
Returns a hash code value for this object.Returns the value of theminVersion
record component.sort()
Returns the value of thesort
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
LeafMetaData
Expert: Sole constructor. Public for use by customLeafReader
impls.
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
createdVersionMajor
public int createdVersionMajor()Returns the value of thecreatedVersionMajor
record component.- Returns:
- the value of the
createdVersionMajor
record component
-
minVersion
Returns the value of theminVersion
record component.- Returns:
- the value of the
minVersion
record component
-
sort
Returns the value of thesort
record component.- Returns:
- the value of the
sort
record component
-
hasBlocks
public boolean hasBlocks()Returns the value of thehasBlocks
record component.- Returns:
- the value of the
hasBlocks
record component
-