Class ImmutableOutputDataMessage

    • Method Detail

      • keepAlive

        public boolean keepAlive()
        Ignore this. For internal use only.
        Specified by:
        keepAlive in interface OutputDataMessage
      • withKeepAlive

        public final ImmutableOutputDataMessage withKeepAlive​(boolean value)
        Copy the current immutable object by setting a value for the keepAlive attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for keepAlive
        Returns:
        A modified copy of the this object
      • withDevice

        public final ImmutableOutputDataMessage withDevice​(@Nullable
                                                           Device value)
        Copy the current immutable object by setting a value for the device attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for device (can be null)
        Returns:
        A modified copy of the this object
      • withPayload

        public final ImmutableOutputDataMessage withPayload​(@Nullable
                                                            byte... elements)
        Copy the current immutable object with elements that replace the content of payload. The array is cloned before being saved as attribute values.
        Parameters:
        elements - The non-null elements for payload
        Returns:
        A modified copy of this object
      • withReceived

        public final ImmutableOutputDataMessage withReceived​(int value)
        Copy the current immutable object by setting a value for the received attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for received
        Returns:
        A modified copy of the this object
      • equals

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableOutputDataMessage that have equal attribute values.
        Overrides:
        equals in class Object
        Returns:
        true if this is equal to another instance
      • hashCode

        public int hashCode()
        Computes a hash code from attributes: keepAlive, device, payload, received.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

        public String toString()
        Prints the immutable value OutputDataMessage with attribute values.
        Overrides:
        toString in class Object
        Returns:
        A string representation of the value
      • copyOf

        public static ImmutableOutputDataMessage copyOf​(OutputDataMessage instance)
        Creates an immutable copy of a OutputDataMessage value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
        Parameters:
        instance - The instance to copy
        Returns:
        A copied immutable OutputDataMessage instance