Record Class QParameterNamed01<T>
java.lang.Object
java.lang.Record
com.io7m.quarrel.core.QParameterNamed01<T>
- Type Parameters:
T- The type of values- Record Components:
name- The namenameAlternatives- The alternative namesdescription- The parameter description stringdefaultValue- The default valuetype- The type of values
- All Implemented Interfaces:
QParameterNamedType<T>, QParameterType<T>
public record QParameterNamed01<T>(String name, List<String> nameAlternatives, QStringType description, Optional<T> defaultValue, Class<T> type)
extends Record
implements QParameterNamedType<T>
A named parameter with [0, 1] cardinality; at most one value must be
present.
-
Constructor Summary
ConstructorsConstructorDescriptionQParameterNamed01(String name, List<String> nameAlternatives, QStringType description, Optional<T> defaultValue, Class<T> type) A named parameter with [0, 1] cardinality; at most one value must be present. -
Method Summary
Modifier and TypeMethodDescriptionintintReturns the value of thedefaultValuerecord component.Returns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.Returns the value of thenameAlternativesrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
QParameterNamed01
public QParameterNamed01(String name, List<String> nameAlternatives, QStringType description, Optional<T> defaultValue, Class<T> type) A named parameter with [0, 1] cardinality; at most one value must be present.- Parameters:
name- The namenameAlternatives- The alternative namesdescription- The parameter description stringdefaultValue- The default valuetype- The type of values
-
-
Method Details
-
cardinalityMinimum
public int cardinalityMinimum()- Specified by:
cardinalityMinimumin interfaceQParameterNamedType<T>- Returns:
- The minimum cardinality of the parameter (typically 0 or 1)
-
cardinalityMaximum
public int cardinalityMaximum()- Specified by:
cardinalityMaximumin interfaceQParameterNamedType<T>- Returns:
- The maximum cardinality of the parameter (typically 1 or MAX_VALUE)
-
toString
-
hashCode
-
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). -
name
-
nameAlternatives
Returns the value of thenameAlternativesrecord component.- Specified by:
nameAlternativesin interfaceQParameterNamedType<T>- Returns:
- the value of the
nameAlternativesrecord component
-
description
Returns the value of thedescriptionrecord component.- Specified by:
descriptionin interfaceQParameterType<T>- Returns:
- the value of the
descriptionrecord component
-
defaultValue
Returns the value of thedefaultValuerecord component.- Returns:
- the value of the
defaultValuerecord component
-
type
-