Record Class UniqueCodeGenerator.Configuration
java.lang.Object
java.lang.Record
dev.getelements.elements.sdk.util.UniqueCodeGenerator.Configuration
- Record Components:
candidates- the candidate characters to use for code generationrandom- the random generatorrejection- the predicate to reject generated codes
- Enclosing class:
UniqueCodeGenerator
public static record UniqueCodeGenerator.Configuration(CharSequence candidates, Random random, int defaultMaxAttempts, Predicate<String> rejection)
extends Record
Configuration for the UniqueCodeGenerator.
-
Constructor Summary
ConstructorsConstructorDescriptionConfiguration(CharSequence candidates, Random random, int defaultMaxAttempts, Predicate<String> rejection) Creates an instance of aConfigurationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecandidatesrecord component.intReturns the value of thedefaultMaxAttemptsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.random()Returns the value of therandomrecord component.Returns the value of therejectionrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Configuration
public Configuration(CharSequence candidates, Random random, int defaultMaxAttempts, Predicate<String> rejection) Creates an instance of aConfigurationrecord class.- Parameters:
candidates- the value for thecandidatesrecord componentrandom- the value for therandomrecord componentdefaultMaxAttempts- the value for thedefaultMaxAttemptsrecord componentrejection- the value for therejectionrecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
candidates
Returns the value of thecandidatesrecord component.- Returns:
- the value of the
candidatesrecord component
-
random
Returns the value of therandomrecord component.- Returns:
- the value of the
randomrecord component
-
defaultMaxAttempts
public int defaultMaxAttempts()Returns the value of thedefaultMaxAttemptsrecord component.- Returns:
- the value of the
defaultMaxAttemptsrecord component
-
rejection
Returns the value of therejectionrecord component.- Returns:
- the value of the
rejectionrecord component
-