Class LuceneGeoPointFieldCodec
java.lang.Object
org.hibernate.search.backend.lucene.types.codec.impl.LuceneGeoPointFieldCodec
- All Implemented Interfaces:
LuceneFieldCodec<GeoPoint,byte[]>
public final class LuceneGeoPointFieldCodec
extends Object
implements LuceneFieldCodec<GeoPoint,byte[]>
-
Constructor Summary
ConstructorsConstructorDescriptionLuceneGeoPointFieldCodec(Indexing indexing, DocValues docValues, Storage storage, GeoPoint indexNullAsValue) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToDocument(LuceneDocumentContent documentBuilder, String absoluteFieldPath, GeoPoint value) Encode the given value in the document by adding new fields to the Lucene document.decode(byte[] field) decode(org.apache.lucene.index.IndexableField field) Extract the value from the given stored field.byte[]Encode the given value.Class<byte[]>booleanisCompatibleWith(LuceneFieldCodec<?, ?> obj) Determine whether the given codec provides an encoding that is compatible with this codec, i.e. whether itsLuceneFieldCodec.decode(IndexableField)andLuceneFieldCodec.encode(Object)methods behave the same way.byte[]raw(org.apache.lucene.index.IndexableField field)
-
Constructor Details
-
LuceneGeoPointFieldCodec
-
-
Method Details
-
addToDocument
public void addToDocument(LuceneDocumentContent documentBuilder, String absoluteFieldPath, GeoPoint value) Description copied from interface:LuceneFieldCodecEncode the given value in the document by adding new fields to the Lucene document.- Specified by:
addToDocumentin interfaceLuceneFieldCodec<GeoPoint,byte[]> - Parameters:
documentBuilder- The document builder.absoluteFieldPath- The absolute path of the field.value- The value to encode.
-
decode
Description copied from interface:LuceneFieldCodecExtract the value from the given stored field.Typically used in projections.
- Specified by:
decodein interfaceLuceneFieldCodec<GeoPoint,byte[]> - Parameters:
field- The document field. Nevernull.- Returns:
- The decoded value.
-
raw
public byte[] raw(org.apache.lucene.index.IndexableField field) - Specified by:
rawin interfaceLuceneFieldCodec<GeoPoint,byte[]>
-
decode
- Specified by:
decodein interfaceLuceneFieldCodec<GeoPoint,byte[]>
-
encode
Description copied from interface:LuceneFieldCodecEncode the given value.Useful for predicates and sorts in particular.
- Specified by:
encodein interfaceLuceneFieldCodec<GeoPoint,byte[]> - Parameters:
value- The value to encode.
-
encodedType
- Specified by:
encodedTypein interfaceLuceneFieldCodec<GeoPoint,byte[]> - Returns:
- The type of the encoded value.
-
isCompatibleWith
Description copied from interface:LuceneFieldCodecDetermine whether the given codec provides an encoding that is compatible with this codec, i.e. whether itsLuceneFieldCodec.decode(IndexableField)andLuceneFieldCodec.encode(Object)methods behave the same way.NOTE:
LuceneFieldCodec.addToDocument(LuceneDocumentContent, String, Object)may behave differently, e.g. it may add docvalues while this codec does not. The behavior ofLuceneFieldCodec.addToDocument(LuceneDocumentContent, String, Object)is considered irrelevant when checking the equivalence of encoding, because such differences should be accounted for through other ways (fields being assigned incompatible predicate factories, etc.).- Specified by:
isCompatibleWithin interfaceLuceneFieldCodec<GeoPoint,byte[]> - Parameters:
obj- AnotherLuceneFieldCodec, nevernull.- Returns:
trueif the given codec is compatible.falseotherwise, or when in doubt.
-