Package org.faktorips.runtime.validation
Record Class StringLengthConstraint
java.lang.Object
java.lang.Record
org.faktorips.runtime.validation.StringLengthConstraint
public record StringLengthConstraint(Charset stringEncoding, int maxStringByteLength)
extends Record
Configuration for string length validation. The encoding is used to transform a String to its
Byte representation, which is then measured against the
maxStringByteLength-
Constructor Summary
ConstructorsConstructorDescriptionStringLengthConstraint(Charset stringEncoding, int maxStringByteLength) Creates an instance of aStringLengthConstraintrecord 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 themaxStringByteLengthrecord component.Returns the value of thestringEncodingrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
StringLengthConstraint
Creates an instance of aStringLengthConstraintrecord class.- Parameters:
stringEncoding- the value for thestringEncodingrecord componentmaxStringByteLength- the value for themaxStringByteLengthrecord 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 '=='. -
stringEncoding
Returns the value of thestringEncodingrecord component.- Returns:
- the value of the
stringEncodingrecord component
-
maxStringByteLength
public int maxStringByteLength()Returns the value of themaxStringByteLengthrecord component.- Returns:
- the value of the
maxStringByteLengthrecord component
-