Class DelegatingBytes32

All Implemented Interfaces:
Comparable<Bytes>, Bytes, Bytes32

public class DelegatingBytes32 extends DelegatingBytes implements Bytes32
A class that holds and delegates all operations to its inner bytes field.

This class may be used to create more types that represent 32 bytes, but need a different name for business logic.

  • Constructor Details

    • DelegatingBytes32

      protected DelegatingBytes32(Bytes delegate)
  • Method Details

    • size

      public int size()
      Description copied from interface: Bytes
      Provides the number of bytes this value represents.
      Specified by:
      size in interface Bytes
      Specified by:
      size in interface Bytes32
      Overrides:
      size in class DelegatingBytes
      Returns:
      The number of bytes this value represents.
    • copy

      public Bytes32 copy()
      Description copied from interface: Bytes
      Return a value equivalent to this one but guaranteed to 1) be deeply immutable (i.e. the underlying value will be immutable) and 2) to not retain more bytes than exposed by the value.
      Specified by:
      copy in interface Bytes
      Specified by:
      copy in interface Bytes32
      Overrides:
      copy in class DelegatingBytes
      Returns:
      A value, equals to this one, but deeply immutable and that doesn't retain any "unreachable" bytes. For performance reasons, this is allowed to return this value however if it already fit those constraints.
    • mutableCopy

      public MutableBytes32 mutableCopy()
      Description copied from interface: Bytes
      Return a new mutable value initialized with the content of this value.
      Specified by:
      mutableCopy in interface Bytes
      Specified by:
      mutableCopy in interface Bytes32
      Overrides:
      mutableCopy in class DelegatingBytes
      Returns:
      A mutable copy of this value. This will copy bytes, modifying the returned value will not modify this value.