Class AbstractBytes

java.lang.Object
org.apache.tuweni.bytes.AbstractBytes
All Implemented Interfaces:
Comparable<Bytes>, Bytes
Direct Known Subclasses:
DelegatingBytes, MutableByteBufferWrappingBytes

public abstract class AbstractBytes extends Object implements Bytes
An abstract Bytes value that provides implementations of equals(Object), hashCode() and toString().
  • Constructor Details

    • AbstractBytes

      public AbstractBytes()
  • Method Details

    • equals

      public boolean equals(Object obj)
      Compare this value and the provided one for equality.

      Two Bytes values are equal is they have contain the exact same bytes.

      Overrides:
      equals in class Object
      Parameters:
      obj - The object to test for equality with.
      Returns:
      true if this value and obj are equal.
    • computeHashcode

      protected int computeHashcode()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Description copied from interface: Bytes
      Return the hexadecimal string representation of this value.
      Specified by:
      toString in interface Bytes
      Overrides:
      toString in class Object
      Returns:
      The hexadecimal representation of this value, starting with "0x".