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 TypeMethodDescriptionbooleanReturns whether this tag is associated with the given value.Returns theStreamof 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 theStreamof values tagged by this tag.Methods inherited from interface org.spongepowered.api.ResourceKeyed
keyMethods inherited from interface org.spongepowered.api.tag.Tag
asDefaultedTag, asScopedTag, registry
-
Method Details
-
of
-
defaultHolder
Supplier<RegistryHolder> defaultHolder() -
values
Returns theStreamof 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, aValueNotFoundExceptionwill be thrown. Therefore, it is advised to callfindValues()instead.- Returns:
- The
Streamof values
-
findValues
Returns theStreamof values tagged by this tag in the holder if it contains this tag'sTag.registry(), orStream.empty()otherwise.- Returns:
- The
Streamof 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
-