Record Class TablePredicate
java.lang.Object
java.lang.Record
top.offsetmonkey538.loottablemodifier.common.api.resource.predicate.table.TablePredicate
- Record Components:
identifiers- the identifiers to match. List entries are in anORrelationshiptypes- the types to match. List entries are in anORrelationship
- All Implemented Interfaces:
Predicate<LootModifierContext>,LootModifierPredicate
public record TablePredicate(@Nullable List<RegexPattern> identifiers, @Nullable List<RegexPattern> types)
extends Record
implements LootModifierPredicate
Matches loot tables based on the identifier and type patterns
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTablePredicate(@Nullable List<RegexPattern> identifiers, @Nullable List<RegexPattern> types) Creates an instance of aTablePredicaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic TablePredicate.Builderbuilder()Creates a builder forTablePredicatefinal 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.@Nullable List<RegexPattern>Returns the value of theidentifiersrecord component.booleantest(@NotNull LootModifierContext context) Tests this predicate against the provided context.final StringtoString()Returns a string representation of this record class.@Nullable List<RegexPattern>types()Returns the value of thetypesrecord component.
-
Field Details
-
CODEC
-
-
Constructor Details
-
TablePredicate
public TablePredicate(@Nullable @Nullable List<RegexPattern> identifiers, @Nullable @Nullable List<RegexPattern> types) Creates an instance of aTablePredicaterecord class.- Parameters:
identifiers- the value for theidentifiersrecord componenttypes- the value for thetypesrecord 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 forTablePredicate- Returns:
- a new
TablePredicate.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). -
identifiers
Returns the value of theidentifiersrecord component.- Returns:
- the value of the
identifiersrecord component
-
types
Returns the value of thetypesrecord component.- Returns:
- the value of the
typesrecord component
-