Record Class InvertedPredicate
java.lang.Object
java.lang.Record
top.offsetmonkey538.loottablemodifier.common.api.resource.predicate.op.InvertedPredicate
- Record Components:
term- the predicate to invert
- All Implemented Interfaces:
Predicate<LootModifierContext>,LootModifierPredicate
public record InvertedPredicate(LootModifierPredicate term)
extends Record
implements LootModifierPredicate
Matches when the provided predicate doesn't
-
Nested Class Summary
Nested classes/interfaces inherited from interface top.offsetmonkey538.loottablemodifier.common.api.resource.predicate.LootModifierPredicate
LootModifierPredicate.Builder -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<InvertedPredicate> -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of aInvertedPredicaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionCreates a builder forInvertedPredicatefinal booleanIndicates whether some other object is "equal to" this one.getType()Returns the type of this action.final inthashCode()Returns a hash code value for this object.term()Returns the value of thetermrecord component.booleantest(@NotNull LootModifierContext context) Tests this predicate against the provided context.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
-
Constructor Details
-
InvertedPredicate
Creates an instance of aInvertedPredicaterecord class.- Parameters:
term- the value for thetermrecord component
-
-
Method Details
-
getType
Description copied from interface:LootModifierPredicateReturns the type of this action.- Specified by:
getTypein interfaceLootModifierPredicate- Returns:
- the
typeof this action.
-
test
Description copied from interface:LootModifierPredicateTests this predicate against the provided context.- Specified by:
testin interfaceLootModifierPredicate- Specified by:
testin interfacePredicate<LootModifierContext>- Parameters:
context- the context to match against- Returns:
- if this predicate matched the provided context
-
builder
Creates a builder forInvertedPredicate- Parameters:
term- the predicate to invert- Returns:
- a new
LootModifierPredicate.Buildercontaining the provided predicate
-
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). -
term
Returns the value of thetermrecord component.- Returns:
- the value of the
termrecord component
-