Package com.mojang.datafixers
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 com.mojang.datafixers.TypeRewriteRule
TypeRewriteRule.All, TypeRewriteRule.CheckOnce, TypeRewriteRule.Everywhere, TypeRewriteRule.IfSame<B>, TypeRewriteRule.Nop, TypeRewriteRule.One, TypeRewriteRule.OrElse, TypeRewriteRule.Seq
-
Constructor Summary
ConstructorDescriptionCheckOnce
(TypeRewriteRule rule, Consumer<Type<?>> onFail) Creates an instance of aCheckOnce
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.onFail()
Returns the value of theonFail
record component.<A> Optional<RewriteResult<A,
?>> rule()
Returns the value of therule
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
CheckOnce
Creates an instance of aCheckOnce
record class.- Parameters:
rule
- the value for therule
record componentonFail
- the value for theonFail
record component
-
-
Method Details
-
rewrite
- Specified by:
rewrite
in interfaceTypeRewriteRule
-
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 withObjects::equals(Object,Object)
. -
rule
Returns the value of therule
record component.- Returns:
- the value of the
rule
record component
-
onFail
Returns the value of theonFail
record component.- Returns:
- the value of the
onFail
record component
-