Package io.papermc.paper.tag

# Class BaseTag<T extends Keyed,C extends BaseTag<T,C>>

java.lang.Object
io.papermc.paper.tag.BaseTag<T,C>

All Implemented Interfaces:
  `Keyed`, `Tag<T>`

Direct Known Subclasses:
  `EntitySetTag`, `MaterialSetTag`

public abstract class BaseTag<T extends Keyed,C extends BaseTag<T,C>> extends Object implements Tag<T>

## Field Summary

Fields
Modifier and Type
Field
Description
`protected final NamespacedKey`
`key`
`protected final Set<T>`
`tagged`

### Fields inherited from interface org.bukkit.Tag

`ACACIA_LOGS, ANVIL, ARROWS, AXOLOTL_TEMPT_ITEMS, BAMBOO_PLANTABLE_ON, BANNERS, BASE_STONE_NETHER, BASE_STONE_OVERWORLD, BEACON_BASE_BLOCKS, BEDS, BEE_GROWABLES, BEEHIVE_INHABITORS, BEEHIVES, BIRCH_LOGS, BUTTONS, CAMPFIRES, CANDLE_CAKES, CANDLES, CARPETS, CAULDRONS, CAVE_VINES, CLIMBABLE, CLUSTER_MAX_HARVESTABLES, COAL_ORES, COPPER_ORES, CORAL_BLOCKS, CORAL_PLANTS, CORALS, CRIMSON_STEMS, CROPS, CRYSTAL_SOUND_BLOCKS, DARK_OAK_LOGS, DEEPSLATE_ORE_REPLACEABLES, DIAMOND_ORES, DIRT, DOORS, DRAGON_IMMUNE, DRIPSTONE_REPLACEABLE, EMERALD_ORES, ENDERMAN_HOLDABLE, ENTITY_TYPES_ARROWS, ENTITY_TYPES_AXOLOTL_ALWAYS_HOSTILES, ENTITY_TYPES_AXOLOTL_HUNT_TARGETS, ENTITY_TYPES_BEEHIVE_INHABITORS, ENTITY_TYPES_FREEZE_HURTS_EXTRA_TYPES, ENTITY_TYPES_FREEZE_IMMUNE_ENTITY_TYPES, ENTITY_TYPES_IMPACT_PROJECTILES, ENTITY_TYPES_POWDER_SNOW_WALKABLE_MOBS, ENTITY_TYPES_RAIDERS, ENTITY_TYPES_SKELETONS, FEATURES_CANNOT_REPLACE, FENCE_GATES, FENCES, FIRE, FLOWER_POTS, FLOWERS, FLUIDS_LAVA, FLUIDS_WATER, FOX_FOOD, FREEZE_IMMUNE_WEARABLES, GEODE_INVALID_BLOCKS, GOLD_ORES, GUARDED_BY_PIGLINS, HOGLIN_REPELLENTS, ICE, IGNORED_BY_PIGLIN_BABIES, IMPACT_PROJECTILES, IMPERMEABLE, INFINIBURN_END, INFINIBURN_NETHER, INFINIBURN_OVERWORLD, INSIDE_STEP_SOUND_BLOCKS, IRON_ORES, ITEMS_ARROWS, ITEMS_BANNERS, ITEMS_BEACON_PAYMENT_ITEMS, ITEMS_BOATS, ITEMS_COALS, ITEMS_CREEPER_DROP_MUSIC_DISCS, ITEMS_FISHES, ITEMS_FURNACE_MATERIALS, ITEMS_LECTERN_BOOKS, ITEMS_MUSIC_DISCS, ITEMS_PIGLIN_LOVED, ITEMS_STONE_TOOL_MATERIALS, JUNGLE_LOGS, LAPIS_ORES, LAVA_POOL_STONE_CANNOT_REPLACE, LEAVES, LOGS, LOGS_THAT_BURN, LUSH_GROUND_REPLACEABLE, MINEABLE_AXE, MINEABLE_HOE, MINEABLE_PICKAXE, MINEABLE_SHOVEL, MOSS_REPLACEABLE, MUSHROOM_GROW_BLOCK, NEEDS_DIAMOND_TOOL, NEEDS_IRON_TOOL, NEEDS_STONE_TOOL, NON_FLAMMABLE_WOOD, NYLIUM, OAK_LOGS, OCCLUDES_VIBRATION_SIGNALS, PIGLIN_FOOD, PIGLIN_REPELLENTS, PLANKS, PORTALS, PRESSURE_PLATES, PREVENT_MOB_SPAWNING_INSIDE, RAIDERS, RAILS, REDSTONE_ORES, REGISTRY_BLOCKS, REGISTRY_ENTITIES, REGISTRY_ENTITY_TYPES, REGISTRY_FLUIDS, REGISTRY_ITEMS, SAND, SAPLINGS, SHULKER_BOXES, SIGNS, SKELETONS, SLABS, SMALL_DRIPLEAF_PLACEABLE, SMALL_FLOWERS, SNOW, SOUL_FIRE_BASE_BLOCKS, SOUL_SPEED_BLOCKS, SPRUCE_LOGS, STAIRS, STANDING_SIGNS, STONE_BRICKS, STONE_ORE_REPLACEABLES, STONE_PRESSURE_PLATES, STRIDER_WARM_BLOCKS, TALL_FLOWERS, TRAPDOORS, UNDERWATER_BONEMEALS, UNSTABLE_BOTTOM_CENTER, VALID_SPAWN, WALL_CORALS, WALL_POST_OVERRIDE, WALL_SIGNS, WALLS, WARPED_STEMS, WART_BLOCKS, WITHER_IMMUNE, WITHER_SUMMON_BASE_BLOCKS, WOODEN_BUTTONS, WOODEN_DOORS, WOODEN_FENCES, WOODEN_PRESSURE_PLATES, WOODEN_SLABS, WOODEN_STAIRS, WOODEN_TRAPDOORS, WOOL`

## Constructor Summary

Constructors
Constructor
Description
`BaseTag(@NotNull Class<T> clazz, @NotNull NamespacedKey key, @NotNull Collection<T> values)`
`BaseTag(@NotNull Class<T> clazz, @NotNull NamespacedKey key, @NotNull Collection<T> values, @NotNull Predicate<T>... globalPredicates)`
`BaseTag(@NotNull Class<T> clazz, @NotNull NamespacedKey key, @NotNull Predicate<T> filter)`
`BaseTag(@NotNull Class<T> clazz, @NotNull NamespacedKey key, @NotNull T... values)`

## Method Summary

Modifier and Type
Method
Description
`C`
`add(@NotNull Collection<T> collection)`
`C`
`add(@NotNull Predicate<T> filter)`
`C`
`add(@NotNull Tag<T>... tags)`
`C`
`add(@NotNull T... values)`
`C`
`contains(@NotNull String with)`
`C`
`endsWith(@NotNull String with)`
`C`
`ensureSize(@NotNull String label, int size)`
`protected abstract @NotNull Set<T>`
`getAllPossibleValues()`
`@NotNull NamespacedKey`
`getKey()`
Return the namespaced identifier for this object.
`protected abstract @NotNull String`
`getName(T value)`
`@NotNull Set<T>`
`getValues()`
Gets an immutable set of all tagged items.
`boolean`
`isTagged(T item)`
Returns whether or not this tag has an entry for the specified item.
`C`
`not(@NotNull Collection<T> values)`
`C`
`not(@NotNull Predicate<T> filter)`
`C`
`not(@NotNull Tag<T>... tags)`
`C`
`not(@NotNull T... values)`
`C`
`notContains(@NotNull String with)`
`C`
`notEndsWith(@NotNull String with)`
`C`
`notStartsWith(@NotNull String with)`
`C`
`startsWith(@NotNull String with)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### key

protected final NamespacedKey key

### tagged

protected final Set<T extends Keyed> tagged

## Constructor Details

### BaseTag

public BaseTag(@NotNull @NotNull Class<T> clazz, @NotNull @NotNull NamespacedKey key, @NotNull @NotNull Predicate<T> filter)

### BaseTag

public BaseTag(@NotNull @NotNull Class<T> clazz, @NotNull @NotNull NamespacedKey key, @NotNull @NotNull T... values)

### BaseTag

public BaseTag(@NotNull @NotNull Class<T> clazz, @NotNull @NotNull NamespacedKey key, @NotNull @NotNull Collection<T> values)

### BaseTag

public BaseTag(@NotNull @NotNull Class<T> clazz, @NotNull @NotNull NamespacedKey key, @NotNull @NotNull Collection<T> values, @NotNull @NotNull Predicate<T>... globalPredicates)

## Method Details

### getKey

@NotNull public @NotNull NamespacedKey getKey()
Description copied from interface: `Keyed`
Return the namespaced identifier for this object.

Specified by:
  `getKey` in interface `Keyed`
Returns:
  this object's key

### getValues

@NotNull public @NotNull Set<T> getValues()
Description copied from interface: `Tag`
Gets an immutable set of all tagged items.

Specified by:
  `getValues` in interface `Tag<T extends Keyed>`
Returns:
  set of tagged items

### isTagged

public boolean isTagged(@NotNull T item)
Description copied from interface: `Tag`
Returns whether or not this tag has an entry for the specified item.

Specified by:
  `isTagged` in interface `Tag<T extends Keyed>`
Parameters:
  `item` - to check
Returns:
  if it is tagged

### add

@NotNull public C add(@NotNull @NotNull Tag<T>... tags)

### add

@NotNull public C add(@NotNull @NotNull T... values)

### add

@NotNull public C add(@NotNull @NotNull Collection<T> collection)

### add

@NotNull public C add(@NotNull @NotNull Predicate<T> filter)

### contains

@NotNull public C contains(@NotNull @NotNull String with)

### endsWith

@NotNull public C endsWith(@NotNull @NotNull String with)

### startsWith

@NotNull public C startsWith(@NotNull @NotNull String with)

### not

@NotNull public C not(@NotNull @NotNull Tag<T>... tags)

### not

@NotNull public C not(@NotNull @NotNull T... values)

### not

@NotNull public C not(@NotNull @NotNull Collection<T> values)

### not

@NotNull public C not(@NotNull @NotNull Predicate<T> filter)

### notContains

@NotNull public C notContains(@NotNull @NotNull String with)

### notEndsWith

@NotNull public C notEndsWith(@NotNull @NotNull String with)

### notStartsWith

@NotNull public C notStartsWith(@NotNull @NotNull String with)

### ensureSize

@NotNull public C ensureSize(@NotNull @NotNull String label, int size)

### getAllPossibleValues

@NotNull protected abstract @NotNull Set<T> getAllPossibleValues()

### getName

@NotNull protected abstract @NotNull String getName(@NotNull T value)