Class KeycloakMarshallUtil
- java.lang.Object
-
- org.keycloak.models.sessions.infinispan.util.KeycloakMarshallUtil
-
public class KeycloakMarshallUtil extends Object
Helper to optimize marshalling/unmarhsalling of some types- Author:
- Marek Posolda
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
KeycloakMarshallUtil.ConcurrentHashMapBuilder<K,V>
static class
KeycloakMarshallUtil.HashSetBuilder<E>
-
Field Summary
Fields Modifier and Type Field Description static org.infinispan.commons.marshall.Externalizer<String>
STRING_EXT
static org.infinispan.commons.marshall.Externalizer<UUID>
UUID_EXT
-
Constructor Summary
Constructors Constructor Description KeycloakMarshallUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
marshall(Integer obj, ObjectOutput output)
Marshalls the given object with support ofnull
values.static <E,T extends Collection<E>>
TreadCollection(ObjectInput input, org.infinispan.commons.marshall.Externalizer<E> valueExternalizer, org.infinispan.commons.marshall.MarshallUtil.CollectionBuilder<E,T> colBuilder)
static <K,V,TYPED_MAP extends Map<K,V>>
TYPED_MAPreadMap(ObjectInput input, org.infinispan.commons.marshall.Externalizer<K> keyExternalizer, org.infinispan.commons.marshall.Externalizer<V> valueExternalizer, org.infinispan.commons.marshall.MarshallUtil.MapBuilder<K,V,TYPED_MAP> mapBuilder)
static Integer
unmarshallInteger(ObjectInput input)
Unmarshals the given object intoInteger
instance.static <E> void
writeCollection(Collection<E> col, org.infinispan.commons.marshall.Externalizer<E> valueExternalizer, ObjectOutput output)
static <K,V>
voidwriteMap(Map<K,V> map, org.infinispan.commons.marshall.Externalizer<K> keyExternalizer, org.infinispan.commons.marshall.Externalizer<V> valueExternalizer, ObjectOutput output)
-
-
-
Method Detail
-
writeMap
public static <K,V> void writeMap(Map<K,V> map, org.infinispan.commons.marshall.Externalizer<K> keyExternalizer, org.infinispan.commons.marshall.Externalizer<V> valueExternalizer, ObjectOutput output) throws IOException
- Throws:
IOException
-
readMap
public static <K,V,TYPED_MAP extends Map<K,V>> TYPED_MAP readMap(ObjectInput input, org.infinispan.commons.marshall.Externalizer<K> keyExternalizer, org.infinispan.commons.marshall.Externalizer<V> valueExternalizer, org.infinispan.commons.marshall.MarshallUtil.MapBuilder<K,V,TYPED_MAP> mapBuilder) throws IOException, ClassNotFoundException
- Throws:
IOException
ClassNotFoundException
-
writeCollection
public static <E> void writeCollection(Collection<E> col, org.infinispan.commons.marshall.Externalizer<E> valueExternalizer, ObjectOutput output) throws IOException
- Throws:
IOException
-
readCollection
public static <E,T extends Collection<E>> T readCollection(ObjectInput input, org.infinispan.commons.marshall.Externalizer<E> valueExternalizer, org.infinispan.commons.marshall.MarshallUtil.CollectionBuilder<E,T> colBuilder) throws ClassNotFoundException, IOException
- Throws:
ClassNotFoundException
IOException
-
marshall
public static void marshall(Integer obj, ObjectOutput output) throws IOException
Marshalls the given object with support ofnull
values.- Parameters:
obj
- Object to marshall (can benull
)output
- Output stream- Throws:
IOException
-
unmarshallInteger
public static Integer unmarshallInteger(ObjectInput input) throws IOException
Unmarshals the given object intoInteger
instance.- Parameters:
input
- Input stream- Returns:
- Unmarshalled value (can be
null
) - Throws:
IOException
-
-