Package org.faktorips.runtime.validation
Record Class NumericConstraint
java.lang.Object
java.lang.Record
org.faktorips.runtime.validation.NumericConstraint
Represents constraints for numeric values.
-
Constructor Summary
ConstructorsConstructorDescriptionNumericConstraint(int precision) Creates a new numeric constraint with the specified precision.NumericConstraint(int precision, int scale) Creates an instance of aNumericConstraintrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of theprecisionrecord component.intscale()Returns the value of thescalerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
NumericConstraint
public NumericConstraint(int precision) Creates a new numeric constraint with the specified precision.- Parameters:
precision- the maximum total number of digits allowed
-
NumericConstraint
public NumericConstraint(int precision, int scale) Creates an instance of aNumericConstraintrecord class.- Parameters:
precision- the value for theprecisionrecord componentscale- the value for thescalerecord 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. All components in this record class are compared with '=='. -
precision
public int precision()Returns the value of theprecisionrecord component.- Returns:
- the value of the
precisionrecord component
-
scale
public int scale()Returns the value of thescalerecord component.- Returns:
- the value of the
scalerecord component
-