Package org.spongepowered.api
Interface ResourceKey.Builder
- All Superinterfaces:
AbstractBuilder<ResourceKey>
,Builder<ResourceKey,
,ResourceKey.Builder> ResettableBuilder<ResourceKey,
ResourceKey.Builder>
- Enclosing interface:
ResourceKey
A builder to create
ResourceKey
s.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds theResourceKey
.Sets the key's namespace.default ResourceKey.Builder
namespace
(org.spongepowered.plugin.PluginContainer container) Sets the key's namespace based on the providedPluginContainer
's identifier.Sets the key's value.
-
Method Details
-
namespace
Sets the key's namespace.If using a
ResourceKey.MINECRAFT_NAMESPACE
orResourceKey.SPONGE_NAMESPACE
, it is preferable to useResourceKey.minecraft(String)
orResourceKey.sponge(String)
instead.- Parameters:
namespace
- The namespace to use- Returns:
- This builder, for chaining
-
namespace
Sets the key's namespace based on the providedPluginContainer
's identifier.- Parameters:
container
- The plugin container to fetch from- Returns:
- This builder, for chaining
-
value
Sets the key's value.- Parameters:
value
- The value to use- Returns:
- This builder, for chaining
-
build
Builds theResourceKey
.- Specified by:
build
in interfaceAbstractBuilder<ResourceKey>
- Returns:
- The built resource key
- Throws:
IllegalStateException
- Ifnamespace(String)
orvalue(String)
are not set.
-