Class PayloadAndErrorPayload<P,​E>

  • Type Parameters:
    P - the type of the normal payload
    E - the type of the error payload

    public final class PayloadAndErrorPayload<P,​E>
    extends Object
    Messages can have both normal and error payload. This class combines these two objects into a single one.
    • Constructor Detail

      • PayloadAndErrorPayload

        public PayloadAndErrorPayload()
    • Method Detail

      • payloadAndErrorPayload

        public static <P,​E> PayloadAndErrorPayload<P,​E> payloadAndErrorPayload​(P payload,
                                                                                           E errorPayload)
        Factory method to create a new PayloadAndErrorPayload object for the given payloads.
        Type Parameters:
        P - the type of the normal payload
        E - the type of the error payload
        Parameters:
        payload - the normal payload
        errorPayload - the error payload
        Returns:
        the newly created PayloadAndErrorPayload object