Record Class CATypeScalarType.Integral
java.lang.Object
java.lang.Record
com.io7m.cardant.model.CATypeScalarType.Integral
- Record Components:
name- The type namedescription- A humanly-readable description of the typerangeLower- The lower bound (inclusive)rangeUpper- The upper bound (inclusive)
- All Implemented Interfaces:
CATypeScalarType
- Enclosing interface:
CATypeScalarType
public static record CATypeScalarType.Integral(CATypeScalarIdentifier name, String description, long rangeLower, long rangeUpper)
extends Record
implements CATypeScalarType
An integer type.
-
Nested Class Summary
Nested classes/interfaces inherited from interface CATypeScalarType
CATypeScalarType.Integral, CATypeScalarType.Kind, CATypeScalarType.Monetary, CATypeScalarType.Real, CATypeScalarType.Text, CATypeScalarType.Time -
Constructor Summary
ConstructorsConstructorDescriptionIntegral(CATypeScalarIdentifier name, String description, long rangeLower, long rangeUpper) An integer type. -
Method Summary
Modifier and TypeMethodDescriptionReturns 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.booleanisValid(long value) kind()name()Returns the value of thenamerecord component.longReturns the value of therangeLowerrecord component.longReturns the value of therangeUpperrecord component.final StringtoString()Returns a string representation of this record class.withName(CATypeScalarIdentifier newName)
-
Constructor Details
-
Integral
An integer type.- Parameters:
name- The type namedescription- A humanly-readable description of the typerangeLower- The lower bound (inclusive)rangeUpper- The upper bound (inclusive)
-
-
Method Details
-
withName
- Specified by:
withNamein interfaceCATypeScalarType- Parameters:
newName- The new name- Returns:
- This type with a new name
-
kind
- Specified by:
kindin interfaceCATypeScalarType- Returns:
- The internal type kind
-
showConstraint
- Specified by:
showConstraintin interfaceCATypeScalarType- Returns:
- A humanly-readable description of this type's value constraints
-
isValid
public boolean isValid(long value) - Parameters:
value- The value- Returns:
trueif the given value is in the range for this type
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
name
Returns the value of thenamerecord component.- Specified by:
namein interfaceCATypeScalarType- Returns:
- the value of the
namerecord component
-
description
Returns the value of thedescriptionrecord component.- Specified by:
descriptionin interfaceCATypeScalarType- Returns:
- the value of the
descriptionrecord component
-
rangeLower
public long rangeLower()Returns the value of therangeLowerrecord component.- Returns:
- the value of the
rangeLowerrecord component
-
rangeUpper
public long rangeUpper()Returns the value of therangeUpperrecord component.- Returns:
- the value of the
rangeUpperrecord component
-