Package org.infinispan.encoding
Class DataConversion
- java.lang.Object
-
- org.infinispan.encoding.DataConversion
-
public final class DataConversion extends java.lang.Object
Handle conversions for Keys or values.- Since:
- 9.2
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DataConversion.Externalizer
-
Field Summary
Fields Modifier and Type Field Description static DataConversion
DEFAULT_KEY
static DataConversion
DEFAULT_VALUE
static DataConversion
IDENTITY_KEY
static DataConversion
IDENTITY_VALUE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
convert(java.lang.Object o, MediaType from, MediaType to)
java.lang.Object
convertToRequestFormat(java.lang.Object o, MediaType contentType)
boolean
equals(java.lang.Object o)
java.lang.Object
extractIndexable(java.lang.Object stored)
java.lang.Object
fromStorage(java.lang.Object stored)
Encoder
getEncoder()
java.lang.Class<? extends Encoder>
getEncoderClass()
MediaType
getRequestMediaType()
MediaType
getStorageMediaType()
Wrapper
getWrapper()
java.lang.Class<? extends Wrapper>
getWrapperClass()
int
hashCode()
void
injectDependencies(GlobalConfiguration gcr, EncoderRegistry encoderRegistry, Configuration configuration)
boolean
isConversionSupported(MediaType mediaType)
boolean
isStorageFormatFilterable()
static DataConversion
newKeyDataConversion(java.lang.Class<? extends Encoder> encoderClass, java.lang.Class<? extends Wrapper> wrapperClass, MediaType storageType)
static DataConversion
newValueDataConversion(java.lang.Class<? extends Encoder> encoderClass, java.lang.Class<? extends Wrapper> wrapperClass, MediaType storageType)
void
overrideWrapper(java.lang.Class<? extends Wrapper> newWrapper, ComponentRegistry cr)
static DataConversion
readFrom(java.io.ObjectInput input)
java.lang.Object
toStorage(java.lang.Object toStore)
java.lang.String
toString()
DataConversion
withEncoding(java.lang.Class<? extends Encoder> encoderClass)
DataConversion
withRequestMediaType(MediaType requestMediaType)
DataConversion
withWrapping(java.lang.Class<? extends Wrapper> wrapperClass)
static void
writeTo(java.io.ObjectOutput output, DataConversion dataConversion)
-
-
-
Field Detail
-
DEFAULT_KEY
public static final DataConversion DEFAULT_KEY
-
DEFAULT_VALUE
public static final DataConversion DEFAULT_VALUE
-
IDENTITY_KEY
public static final DataConversion IDENTITY_KEY
-
IDENTITY_VALUE
public static final DataConversion IDENTITY_VALUE
-
-
Method Detail
-
getRequestMediaType
public MediaType getRequestMediaType()
-
withRequestMediaType
public DataConversion withRequestMediaType(MediaType requestMediaType)
-
withEncoding
public DataConversion withEncoding(java.lang.Class<? extends Encoder> encoderClass)
-
withWrapping
public DataConversion withWrapping(java.lang.Class<? extends Wrapper> wrapperClass)
-
overrideWrapper
public void overrideWrapper(java.lang.Class<? extends Wrapper> newWrapper, ComponentRegistry cr)
-
isConversionSupported
public boolean isConversionSupported(MediaType mediaType)
-
convertToRequestFormat
public java.lang.Object convertToRequestFormat(java.lang.Object o, MediaType contentType)
-
injectDependencies
public void injectDependencies(GlobalConfiguration gcr, EncoderRegistry encoderRegistry, Configuration configuration)
-
getStorageMediaType
public MediaType getStorageMediaType()
-
fromStorage
public java.lang.Object fromStorage(java.lang.Object stored)
-
toStorage
public java.lang.Object toStorage(java.lang.Object toStore)
-
extractIndexable
public java.lang.Object extractIndexable(java.lang.Object stored)
-
getEncoder
public Encoder getEncoder()
-
getWrapper
public Wrapper getWrapper()
-
getEncoderClass
public java.lang.Class<? extends Encoder> getEncoderClass()
-
getWrapperClass
public java.lang.Class<? extends Wrapper> getWrapperClass()
-
isStorageFormatFilterable
public boolean isStorageFormatFilterable()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
newKeyDataConversion
public static DataConversion newKeyDataConversion(java.lang.Class<? extends Encoder> encoderClass, java.lang.Class<? extends Wrapper> wrapperClass, MediaType storageType)
-
newValueDataConversion
public static DataConversion newValueDataConversion(java.lang.Class<? extends Encoder> encoderClass, java.lang.Class<? extends Wrapper> wrapperClass, MediaType storageType)
-
writeTo
public static void writeTo(java.io.ObjectOutput output, DataConversion dataConversion) throws java.io.IOException
- Throws:
java.io.IOException
-
readFrom
public static DataConversion readFrom(java.io.ObjectInput input) throws java.io.IOException, java.lang.ClassNotFoundException
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
-
-