Package com.io7m.coffeepick.api
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCoffeePickVerification.BuilderBuilds instances of typeCoffeePickVerification.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CoffeePickVerification.Builderbuilder()Creates a builder forCoffeePickVerification.static CoffeePickVerificationcopyOf(CoffeePickVerificationType instance)Creates an immutable copy of aCoffeePickVerificationTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofCoffeePickVerificationthat have equal attribute values.RuntimeHashexpectedHash()inthashCode()Computes a hash code from attributes:expectedHash,receivedHash.RuntimeHashreceivedHash()java.lang.StringtoString()Prints the immutable valueCoffeePickVerificationwith attribute values.CoffeePickVerificationwithExpectedHash(RuntimeHash value)Copy the current immutable object by setting a value for theexpectedHashattribute.CoffeePickVerificationwithReceivedHash(RuntimeHash value)Copy the current immutable object by setting a value for thereceivedHashattribute.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.io7m.coffeepick.api.CoffeePickVerificationType
isVerified
-
-
-
-
Method Detail
-
expectedHash
public RuntimeHash expectedHash()
- Specified by:
expectedHashin interfaceCoffeePickVerificationType- Returns:
- The expected hash value
-
receivedHash
public RuntimeHash receivedHash()
- Specified by:
receivedHashin interfaceCoffeePickVerificationType- Returns:
- The received hash value
-
withExpectedHash
public final CoffeePickVerification withExpectedHash(RuntimeHash value)
Copy the current immutable object by setting a value for theexpectedHashattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for expectedHash- Returns:
- A modified copy of the
thisobject
-
withReceivedHash
public final CoffeePickVerification withReceivedHash(RuntimeHash value)
Copy the current immutable object by setting a value for thereceivedHashattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for receivedHash- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(java.lang.Object another)
This instance is equal to all instances ofCoffeePickVerificationthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:expectedHash,receivedHash.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueCoffeePickVerificationwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static CoffeePickVerification copyOf(CoffeePickVerificationType instance)
Creates an immutable copy of aCoffeePickVerificationTypevalue. 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 forCoffeePickVerification.CoffeePickVerification.builder() .setExpectedHash(com.io7m.coffeepick.runtime.RuntimeHash) // requiredexpectedHash.setReceivedHash(com.io7m.coffeepick.runtime.RuntimeHash) // requiredreceivedHash.build();- Returns:
- A new CoffeePickVerification builder
-
-