Record Class TemplateParser.ValidationResult
java.lang.Object
java.lang.Record
cloud.opencode.base.sms.template.TemplateParser.ValidationResult
- Record Components:
valid- whether valid | 是否有效requiredVariables- required variable names | 必需的变量名missingVariables- missing variable names | 缺失的变量名extraVariables- extra variable names | 多余的变量名
- Enclosing class:
TemplateParser
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of theextraVariablesrecord component.Get error message 获取错误消息booleanhasExtra()Check if has extra variables 检查是否有多余变量final inthashCode()Returns a hash code value for this object.booleanCheck if has missing variables 检查是否有缺失变量Returns the value of themissingVariablesrecord component.Returns the value of therequiredVariablesrecord component.final StringtoString()Returns a string representation of this record class.booleanvalid()Returns the value of thevalidrecord component.
-
Constructor Details
-
ValidationResult
public ValidationResult(boolean valid, List<String> requiredVariables, List<String> missingVariables, List<String> extraVariables) Creates an instance of aValidationResultrecord class.- Parameters:
valid- the value for thevalidrecord componentrequiredVariables- the value for therequiredVariablesrecord componentmissingVariables- the value for themissingVariablesrecord componentextraVariables- the value for theextraVariablesrecord component
-
-
Method Details
-
hasMissing
public boolean hasMissing()Check if has missing variables 检查是否有缺失变量- Returns:
- true if has missing | 如果有缺失返回true
-
hasExtra
public boolean hasExtra()Check if has extra variables 检查是否有多余变量- Returns:
- true if has extra | 如果有多余返回true
-
getErrorMessage
Get error message 获取错误消息- Returns:
- the error message or null | 错误消息或null
-
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. -
valid
-
requiredVariables
Returns the value of therequiredVariablesrecord component.- Returns:
- the value of the
requiredVariablesrecord component
-
missingVariables
Returns the value of themissingVariablesrecord component.- Returns:
- the value of the
missingVariablesrecord component
-
extraVariables
Returns the value of theextraVariablesrecord component.- Returns:
- the value of the
extraVariablesrecord component
-