Class SetCodec<T>

  • All Implemented Interfaces:
    Codec<java.util.Set<T>>

    public class SetCodec<T>
    extends java.lang.Object
    implements Codec<java.util.Set<T>>
    • Constructor Summary

      Constructors 
      Constructor Description
      SetCodec​(Codec<T> tc, java.util.function.Supplier<java.util.Set<T>> s)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Set<T> decode​(java.io.InputStream in)
      Decode a serialized instance into an in-memory object of type T.
      void encode​(java.io.OutputStream out, java.util.Set<T> set)
      Encode an in-memory object into serialized form.
      java.lang.String getTypeName()
      Gets the portable name for the type used in protobuf.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SetCodec

        public SetCodec​(Codec<T> tc,
                        java.util.function.Supplier<java.util.Set<T>> s)
    • Method Detail

      • getTypeName

        public java.lang.String getTypeName()
        Description copied from interface: Codec
        Gets the portable name for the type used in protobuf.
        Specified by:
        getTypeName in interface Codec<T>
        Returns:
        The name of the type.
      • decode

        public java.util.Set<T> decode​(java.io.InputStream in)
                                throws java.io.IOException
        Description copied from interface: Codec
        Decode a serialized instance into an in-memory object of type T.
        Specified by:
        decode in interface Codec<T>
        Parameters:
        in - The input stream the object is to be decoded from.
        Returns:
        The decoded object.
        Throws:
        java.io.IOException
      • encode

        public void encode​(java.io.OutputStream out,
                           java.util.Set<T> set)
                    throws java.io.IOException
        Description copied from interface: Codec
        Encode an in-memory object into serialized form.
        Specified by:
        encode in interface Codec<T>
        Parameters:
        out - The output stream to send the serialized object to.
        set - The in-memory object to be serialized.
        Throws:
        java.io.IOException