Record Class EntryItemPredicate
java.lang.Object
java.lang.Record
top.offsetmonkey538.loottablemodifier.common.api.resource.predicate.entry.EntryItemPredicate
- Record Components:
name- theRegexPatternmatching the item identifier
- All Implemented Interfaces:
Predicate<LootModifierContext>,LootModifierPredicate
Matches an item entry based on its item
-
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<EntryItemPredicate> -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of aEntryItemPredicaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionCreates a builder forEntryItemPredicatematching the item based on the provided identifierbuilder(RegexPattern name) Creates a builder forEntryItemPredicatematching the provided itemCreates a builder forEntryItemPredicatematching the provided itemfinal 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.name()Returns the value of thenamerecord 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
-
EntryItemPredicate
Creates an instance of aEntryItemPredicaterecord class.- Parameters:
name- the value for thenamerecord 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 forEntryItemPredicatematching the provided item- Parameters:
name- the item to match- Returns:
- a new
LootModifierPredicate.Builder
-
builder
Creates a builder forEntryItemPredicatematching the item based on the provided identifier- Parameters:
name- the item id to match- Returns:
- a new
LootModifierPredicate.Builder
-
builder
Creates a builder forEntryItemPredicatematching the provided item- Parameters:
name- theRegexPatternto match the item id with- Returns:
- a new
LootModifierPredicate.Builder
-
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). -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-