Class PairEncoderFactory<A extends java.io.Serializable,​B extends java.io.Serializable>

  • Type Parameters:
    A - type for the left coder.
    B - type for the right coder.
    All Implemented Interfaces:
    java.io.Serializable, EncoderFactory<Pair<A,​B>>

    public final class PairEncoderFactory<A extends java.io.Serializable,​B extends java.io.Serializable>
    extends java.lang.Object
    implements EncoderFactory<Pair<A,​B>>
    An EncoderFactory for Pair. Reference: KvCoder in BEAM.
    See Also:
    Serialized Form
    • Method Detail

      • of

        public static <A extends java.io.Serializable,​B extends java.io.Serializable> PairEncoderFactory<A,​B> of​(EncoderFactory<A> leftEncoderFactory,
                                                                                                                             EncoderFactory<B> rightEncoderFactory)
        static initializer of the class.
        Type Parameters:
        A - type of the left element.
        B - type of the right element.
        Parameters:
        leftEncoderFactory - left coder.
        rightEncoderFactory - right coder.
        Returns:
        the new PairEncoderFactory.
      • create

        public EncoderFactory.Encoder<Pair<A,​B>> create​(java.io.OutputStream outputStream)
                                                       throws java.io.IOException
        Description copied from interface: EncoderFactory
        Get an encoder instance.
        Specified by:
        create in interface EncoderFactory<A extends java.io.Serializable>
        Parameters:
        outputStream - the stream on which encoded bytes are written
        Returns:
        the encoder instance.
        Throws:
        java.io.IOException - if fail to get the instance.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object