Class LuceneBigDecimalFieldCodec
- java.lang.Object
-
- org.hibernate.search.backend.lucene.types.codec.impl.AbstractLuceneNumericFieldCodec<BigDecimal,Long>
-
- org.hibernate.search.backend.lucene.types.codec.impl.LuceneBigDecimalFieldCodec
-
- All Implemented Interfaces:
LuceneFieldCodec<BigDecimal>,LuceneStandardFieldCodec<BigDecimal,Long>
public final class LuceneBigDecimalFieldCodec extends AbstractLuceneNumericFieldCodec<BigDecimal,Long>
-
-
Constructor Summary
Constructors Constructor Description LuceneBigDecimalFieldCodec(Indexing indexing, DocValues docValues, Storage storage, BigDecimal indexNullAsValue, int decimalScale)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BigDecimaldecode(Long encoded)BigDecimaldecode(org.apache.lucene.index.IndexableField field)Extract the value from the given stored field.Longencode(BigDecimal value)Encode the given value.LuceneNumericDomain<Long>getDomain()booleanisCompatibleWith(LuceneFieldCodec<?> obj)Determine whether the given codec provides an encoding that is compatible with this codec, i.e.StringtoString()-
Methods inherited from class org.hibernate.search.backend.lucene.types.codec.impl.AbstractLuceneNumericFieldCodec
addToDocument
-
-
-
-
Constructor Detail
-
LuceneBigDecimalFieldCodec
public LuceneBigDecimalFieldCodec(Indexing indexing, DocValues docValues, Storage storage, BigDecimal indexNullAsValue, int decimalScale)
-
-
Method Detail
-
decode
public BigDecimal decode(org.apache.lucene.index.IndexableField field)
Description copied from interface:LuceneFieldCodecExtract the value from the given stored field.Typically used in projections.
- Parameters:
field- The document field. Nevernull.- Returns:
- The decoded value.
-
encode
public Long encode(BigDecimal value)
Description copied from interface:LuceneStandardFieldCodecEncode the given value.Useful for predicates and sorts in particular.
- Parameters:
value- The value to encode.
-
decode
public BigDecimal decode(Long encoded)
- Specified by:
decodein classAbstractLuceneNumericFieldCodec<BigDecimal,Long>
-
getDomain
public LuceneNumericDomain<Long> getDomain()
- Specified by:
getDomainin classAbstractLuceneNumericFieldCodec<BigDecimal,Long>
-
isCompatibleWith
public boolean isCompatibleWith(LuceneFieldCodec<?> obj)
Description copied from interface:LuceneFieldCodecDetermine whether the given codec provides an encoding that is compatible with this codec, i.e. whether itsLuceneFieldCodec.decode(IndexableField)andLuceneStandardFieldCodec.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<BigDecimal>- Overrides:
isCompatibleWithin classAbstractLuceneNumericFieldCodec<BigDecimal,Long>- Parameters:
obj- AnotherLuceneFieldCodec, nevernull.- Returns:
trueif the given codec is compatible.falseotherwise, or when in doubt.
-
-