Class DelegatingBytes48

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

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

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

  • Constructor Details

    • DelegatingBytes48

      protected DelegatingBytes48(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 Bytes48
      Overrides:
      size in class DelegatingBytes
      Returns:
      The number of bytes this value represents.
    • copy

      public Bytes48 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 Bytes48
      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 MutableBytes48 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 Bytes48
      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.