Record Class TypeRewriteRule.CheckOnce
java.lang.Object
java.lang.Record
com.mojang.datafixers.TypeRewriteRule.CheckOnce
- All Implemented Interfaces:
TypeRewriteRule
- Enclosing interface:
TypeRewriteRule
public static record TypeRewriteRule.CheckOnce(TypeRewriteRule rule, Consumer<Type<?>> onFail)
extends Record
implements TypeRewriteRule
-
Nested Class Summary
Nested classes/interfaces inherited from interface TypeRewriteRule
TypeRewriteRule.All, TypeRewriteRule.CheckOnce, TypeRewriteRule.Everywhere, TypeRewriteRule.IfSame<B>, TypeRewriteRule.Nop, TypeRewriteRule.One, TypeRewriteRule.OrElse, TypeRewriteRule.Seq -
Field Summary
FieldsModifier and TypeFieldDescriptionThe field for theonFailrecord component.private final TypeRewriteRuleThe field for therulerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionCheckOnce(TypeRewriteRule rule, Consumer<Type<?>> onFail) Creates an instance of aCheckOncerecord 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.onFail()Returns the value of theonFailrecord component.<A> Optional<RewriteResult<A, ?>> rule()Returns the value of therulerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
rule
The field for therulerecord component. -
onFail
-
-
Constructor Details
-
CheckOnce
Creates an instance of aCheckOncerecord class.- Parameters:
rule- the value for therulerecord componentonFail- the value for theonFailrecord component
-
-
Method Details
-
rewrite
- Specified by:
rewritein interfaceTypeRewriteRule
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
rule
Returns the value of therulerecord component.- Returns:
- the value of the
rulerecord component
-
onFail
-