Package org.spongepowered.api.tag
Interface DefaultedTag<T>
- All Superinterfaces:
Keyed
,ResourceKeyed
,Tag<T>
A
Tag
paired with the RegistryHolder
.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.spongepowered.api.tag.Tag
Tag.Factory
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns whether this tag is associated with the given value.Returns theStream
of values tagged by this tag in the holder if it contains this tag'sTag.registry()
, orStream.empty()
otherwise.static <T> DefaultedTag
<T> of
(DefaultedRegistryType<T> registryType, ResourceKey location) values()
Returns theStream
of values tagged by this tag.Methods inherited from interface org.spongepowered.api.ResourceKeyed
key
Methods inherited from interface org.spongepowered.api.tag.Tag
asDefaultedTag, asScopedTag, registry
-
Method Details
-
of
-
defaultHolder
Supplier<RegistryHolder> defaultHolder() -
values
Returns theStream
of values tagged by this tag.Great care needs to be made in calling this method with any uncertainty as to if the
Tag.registry()
will exist in the holder. Should the key lack a value, aValueNotFoundException
will be thrown. Therefore, it is advised to callfindValues()
instead.- Returns:
- The
Stream
of values
-
findValues
Returns theStream
of values tagged by this tag in the holder if it contains this tag'sTag.registry()
, orStream.empty()
otherwise.- Returns:
- The
Stream
of values
-
contains
Returns whether this tag is associated with the given value.- Parameters:
value
- The value- Returns:
- true if this tag is associated with the given value
-