Class KeycloakMarshallUtil
java.lang.Object
org.keycloak.models.sessions.infinispan.util.KeycloakMarshallUtil
Helper to optimize marshalling/unmarhsalling of some types
- Author:
- Marek Posolda
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidmarshall(Integer obj, ObjectOutput output) Marshalls the given object with support ofnullvalues.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 IntegerunmarshallInteger(ObjectInput input) Unmarshals the given object intoIntegerinstance.static <E> voidwriteCollection(Collection<E> col, org.infinispan.commons.marshall.Externalizer<E> valueExternalizer, ObjectOutput output) 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)
-
Field Details
-
STRING_EXT
-
UUID_EXT
-
-
Constructor Details
-
KeycloakMarshallUtil
public KeycloakMarshallUtil()
-
-
Method Details
-
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 readMapTYPED_MAP extends Map<K, V>> (ObjectInput input, org.infinispan.commons.marshall.Externalizer<K> keyExternalizer, org.infinispan.commons.marshall.Externalizer<V> valueExternalizer, org.infinispan.commons.marshall.MarshallUtil.MapBuilder<K, V, throws IOException, ClassNotFoundExceptionTYPED_MAP> mapBuilder) - Throws:
IOExceptionClassNotFoundException
-
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:
ClassNotFoundExceptionIOException
-
marshall
Marshalls the given object with support ofnullvalues.- Parameters:
obj- Object to marshall (can benull)output- Output stream- Throws:
IOException
-
unmarshallInteger
Unmarshals the given object intoIntegerinstance.- Parameters:
input- Input stream- Returns:
- Unmarshalled value (can be
null) - Throws:
IOException
-