Class KeycloakMarshallUtil


  • public class KeycloakMarshallUtil
    extends Object
    Helper to optimize marshalling/unmarhsalling of some types
    Author:
    Marek Posolda
    • Field Detail

      • STRING_EXT

        public static final org.infinispan.commons.marshall.Externalizer<String> STRING_EXT
      • UUID_EXT

        public static final org.infinispan.commons.marshall.Externalizer<UUID> UUID_EXT
    • Constructor Detail

      • KeycloakMarshallUtil

        public KeycloakMarshallUtil()
    • 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
      • marshall

        public static void marshall​(Integer obj,
                                    ObjectOutput output)
                             throws IOException
        Marshalls the given object with support of null values.
        Parameters:
        obj - Object to marshall (can be null)
        output - Output stream
        Throws:
        IOException
      • unmarshallInteger

        public static Integer unmarshallInteger​(ObjectInput input)
                                         throws IOException
        Unmarshals the given object into Integer instance.
        Parameters:
        input - Input stream
        Returns:
        Unmarshalled value (can be null)
        Throws:
        IOException