Package com.io7m.idstore.model
Record Class IdToken
java.lang.Object
java.lang.Record
com.io7m.idstore.model.IdToken
- Record Components:
value
- The token string
A generic token.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.static IdToken
generate()
Generate a random token, using a default strong RNG instance.static IdToken
generate
(SecureRandom random) Generate a random token.final int
hashCode()
Returns a hash code value for this object.toString()
Returns a string representation of this record class.value()
Returns the value of thevalue
record component.
-
Field Details
-
VALID_HEX
The pattern that defines a valid token.
-
-
Constructor Details
-
IdToken
A generic token.- Parameters:
value
- The token string
-
-
Method Details
-
generate
Generate a random token.- Parameters:
random
- The secure random instance- Returns:
- A random token
-
generate
Generate a random token, using a default strong RNG instance.- Returns:
- A random token
-
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. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code 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)
. -
value
Returns the value of thevalue
record component.- Returns:
- the value of the
value
record component
-