Class Identity

  • All Implemented Interfaces:
    Bytes

    public final class Identity
    extends Object
    implements Bytes
    An identity relation implementation of the Bytes interface.

    This class guarantees: Arrays.equals(argument, value), where argument is the array passed through the constructor and value is the result of this.asArray().

    • Constructor Detail

      • Identity

        public Identity​(byte... argument)
        Constructs a new Identity by passing in the argument.

        this object stores a copy of the argument!

        Parameters:
        argument - the argument of this Identity
    • Method Detail

      • asArray

        public byte[] asArray()
        Returns this byte sequence as an array.

        This is the value of this Identity.

        Specified by:
        asArray in interface Bytes
        Returns:
        a fresh byte array copy of this byte sequence