Class CoffeePickVerification

java.lang.Object
com.io7m.coffeepick.api.CoffeePickVerification
All Implemented Interfaces:
CoffeePickVerificationType

public final class CoffeePickVerification
extends java.lang.Object
implements CoffeePickVerificationType
A value indicating whether or not the verification of an inventory item succeeded.
  • Method Details

    • expectedHash

      public RuntimeHash expectedHash()
      Specified by:
      expectedHash in interface CoffeePickVerificationType
      Returns:
      The expected hash value
    • receivedHash

      public RuntimeHash receivedHash()
      Specified by:
      receivedHash in interface CoffeePickVerificationType
      Returns:
      The received hash value
    • withExpectedHash

      public final CoffeePickVerification withExpectedHash​(RuntimeHash value)
      Copy the current immutable object by setting a value for the expectedHash attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for expectedHash
      Returns:
      A modified copy of the this object
    • withReceivedHash

      public final CoffeePickVerification withReceivedHash​(RuntimeHash value)
      Copy the current immutable object by setting a value for the receivedHash attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for receivedHash
      Returns:
      A modified copy of the this object
    • equals

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

      public int hashCode()
      Computes a hash code from attributes: expectedHash, receivedHash.
      Overrides:
      hashCode in class java.lang.Object
      Returns:
      hashCode value
    • toString

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

      public static CoffeePickVerification copyOf​(CoffeePickVerificationType instance)
      Creates an immutable copy of a CoffeePickVerificationType 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 CoffeePickVerification instance
    • builder

      public static CoffeePickVerification.Builder builder()
      Creates a builder for CoffeePickVerification.
       CoffeePickVerification.builder()
          .setExpectedHash(com.io7m.coffeepick.runtime.RuntimeHash) // required expectedHash
          .setReceivedHash(com.io7m.coffeepick.runtime.RuntimeHash) // required receivedHash
          .build();
       
      Returns:
      A new CoffeePickVerification builder