Record Class FieldValue.ValidationResult
java.lang.Object
java.lang.Record
tech.ydb.yoj.databind.expression.values.FieldValue.ValidationResult
- Enclosing interface:
- FieldValue
-
Constructor Summary
ConstructorsConstructorDescriptionValidationResult(boolean valid, Function<String, ? extends IllegalExpressionException> userException, Function<String, String> internalErrorMessage) Creates an instance of aValidationResultrecord 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.Returns the value of theinternalErrorMessagerecord component.booleaninvalid()static FieldValue.ValidationResultinvalidFieldValue(Function<String, ? extends IllegalExpressionException> userException, Function<String, String> internalError) throwInternalError(String fieldPath) throwUserException(String userFieldPath) final StringtoString()Returns a string representation of this record class.Function<String,? extends IllegalExpressionException> Returns the value of theuserExceptionrecord component.booleanvalid()Returns the value of thevalidrecord component.static FieldValue.ValidationResult
-
Constructor Details
-
ValidationResult
public ValidationResult(boolean valid, Function<String, ? extends IllegalExpressionException> userException, Function<String, String> internalErrorMessage) Creates an instance of aValidationResultrecord class.- Parameters:
valid- the value for thevalidrecord componentuserException- the value for theuserExceptionrecord componentinternalErrorMessage- the value for theinternalErrorMessagerecord component
-
-
Method Details
-
validFieldValue
-
invalidFieldValue
public static FieldValue.ValidationResult invalidFieldValue(Function<String, ? extends IllegalExpressionException> userException, Function<String, String> internalError) -
throwUserException
public IllegalExpressionException throwUserException(String userFieldPath) throws IllegalExpressionException - Throws:
IllegalExpressionException
-
throwInternalError
- Throws:
RuntimeException
-
invalid
public boolean invalid() -
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 '=='. -
valid
public boolean valid()Returns the value of thevalidrecord component.- Returns:
- the value of the
validrecord component
-
userException
Returns the value of theuserExceptionrecord component.- Returns:
- the value of the
userExceptionrecord component
-
internalErrorMessage
Returns the value of theinternalErrorMessagerecord component.- Returns:
- the value of the
internalErrorMessagerecord component
-