Package com.io7m.sunburst.model
Record Class SBHash
java.lang.Object
java.lang.Record
com.io7m.sunburst.model.SBHash
- Record Components:
algorithm- The hash algorithmvalue- The hash value
- All Implemented Interfaces:
Comparable<SBHash>
public record SBHash(SBHashAlgorithm algorithm, byte[] value)
extends Record
implements Comparable<SBHash>
A hash value.
-
Constructor Summary
ConstructorsConstructorDescriptionSBHash(SBHashAlgorithm algorithm, byte[] value) Creates an instance of aSBHashrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thealgorithmrecord component.intbooleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.static SBHashhashOf(SBHashAlgorithm algorithm, InputStream stream) Produce a hash of the given input stream.toString()Returns a string representation of this record class.byte[]value()Returns the value of thevaluerecord component.
-
Constructor Details
-
Method Details
-
compareTo
- Specified by:
compareToin interfaceComparable<SBHash>
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
hashOf
Produce a hash of the given input stream.- Parameters:
algorithm- The algorithmstream- The input stream- Returns:
- A hash value
- Throws:
IOException- On errors
-
algorithm
Returns the value of thealgorithmrecord component.- Returns:
- the value of the
algorithmrecord component
-
value
public byte[] value()Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-