Package org.apache.ignite.marshaller
Class Marshallers
- java.lang.Object
-
- org.apache.ignite.marshaller.Marshallers
-
public class Marshallers extends Object
Factory to create implementation ofMarshaller.
-
-
Field Summary
Fields Modifier and Type Field Description static ThreadLocal<Boolean>USE_CACHEFlag whether class caching should be used by the current thread.static booleanUSE_DFLT_SUIDUse defaultserialVersionUIDforSerializableclasses.
-
Constructor Summary
Constructors Constructor Description Marshallers()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static JdkMarshallerjdk()static JdkMarshallerjdk(@Nullable IgnitePredicate<String> clsFilter)static voidmarshal(Marshaller marsh, @Nullable Object obj, OutputStream out)Marshals object to byte array.static byte[]marshal(Marshaller marsh, Object obj)Marshals object to byte array.static org.apache.ignite.internal.marshaller.optimized.OptimizedMarshalleroptimized()static org.apache.ignite.internal.marshaller.optimized.OptimizedMarshalleroptimized(boolean requireSer)Creates new marshaller providing whether it should requireSerializableinterface or not.
-
-
-
Field Detail
-
USE_CACHE
public static final ThreadLocal<Boolean> USE_CACHE
Flag whether class caching should be used by the current thread.
-
USE_DFLT_SUID
public static final boolean USE_DFLT_SUID
Use defaultserialVersionUIDforSerializableclasses.
-
-
Method Detail
-
jdk
public static JdkMarshaller jdk()
- Returns:
- Default instance of
JdkMarshaller.
-
jdk
public static JdkMarshaller jdk(@Nullable @Nullable IgnitePredicate<String> clsFilter)
- Parameters:
clsFilter- Class filter.- Returns:
- Filtered instance of
JdkMarshaller.
-
optimized
public static org.apache.ignite.internal.marshaller.optimized.OptimizedMarshaller optimized()
- Returns:
- Optimized marshaller instance.
-
optimized
public static org.apache.ignite.internal.marshaller.optimized.OptimizedMarshaller optimized(boolean requireSer)
Creates new marshaller providing whether it should requireSerializableinterface or not.- Parameters:
requireSer- Whether to requireSerializable.- Returns:
- Optimized marshaller instance.
-
marshal
public static byte[] marshal(Marshaller marsh, Object obj) throws IgniteCheckedException
Marshals object to byte array. This method wraps marshaller invocations and guaranty throwsIgniteCheckedExceptionin fail case.- Parameters:
marsh- Marshaller.obj- Object to marshal.- Returns:
- Byte array.
- Throws:
IgniteCheckedException- If marshalling failed.
-
marshal
public static void marshal(Marshaller marsh, @Nullable @Nullable Object obj, OutputStream out) throws IgniteCheckedException
Marshals object to byte array. This method wraps marshaller invocations and guaranty throwsIgniteCheckedExceptionin fail case.- Parameters:
marsh- Marshaller.obj- Object to marshal.out- Output stream.- Throws:
IgniteCheckedException- If marshalling failed.
-
-