public class PortableUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static Map<Byte,Class<?>> |
FLAG_TO_CLASS |
static Map<Class<?>,Byte> |
PLAIN_CLASS_TO_FLAG |
| Constructor and Description |
|---|
PortableUtils() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isPlainArrayType(int type)
Checks whether an array type values can or can not contain references to other object.
|
static boolean |
isPlainType(int type) |
static boolean |
isPortableOrCollectionType(Class<?> cls)
Tells whether provided type is portable or a collection.
|
static boolean |
isPortableType(Class<?> cls)
Tells whether provided type is portable.
|
static <K,V> Map<K,V> |
newMap(Map<K,V> map)
Attempts to create a new map of the same type as
map has. |
static <V> Set<V> |
newSet(Set<V> set)
Attempts to create a new set of the same type as
set has. |
static byte |
typeByClass(Class<?> cls) |
static Object |
unwrapLazy(Object obj) |
static Iterator<Object> |
unwrapLazyIterator(Iterator<Object> delegate) |
static void |
writePlainObject(PortableWriterExImpl writer,
Object val)
Write value with flag. e.g. writePlainObject(writer, (byte)77) will write two byte: {BYTE, 77}.
|
public static void writePlainObject(PortableWriterExImpl writer, Object val)
writer - Wval - Value.public static Object unwrapLazy(@Nullable Object obj)
obj - Value to unwrap.public static Iterator<Object> unwrapLazyIterator(Iterator<Object> delegate)
delegate - Iterator to delegate.public static boolean isPlainType(int type)
true if content of serialized value cannot contain references to other object.public static boolean isPlainArrayType(int type)
type - Array type.true if content of serialized array value cannot contain references to other object.public static byte typeByClass(Class<?> cls)
cls - Class.public static boolean isPortableOrCollectionType(Class<?> cls)
cls - Class to check.public static boolean isPortableType(Class<?> cls)
cls - Class to check.public static <K,V> Map<K,V> newMap(Map<K,V> map)
map has. Otherwise returns new HashMap instance.map - Original map.
Follow @ApacheIgnite
Ignite Fabric : ver. 1.4.0 Release Date : September 24 2015