Package org.spongepowered.api
Interface ResourceKey.Builder
-
- All Superinterfaces:
AbstractBuilder<ResourceKey>
,Buildable.Builder<ResourceKey>
,Builder<ResourceKey,ResourceKey.Builder>
,ResettableBuilder<ResourceKey,ResourceKey.Builder>
- Enclosing interface:
- ResourceKey
public static interface ResourceKey.Builder extends Builder<ResourceKey,ResourceKey.Builder>
A builder to createResourceKey
s.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ResourceKey
build()
Builds theResourceKey
.ResourceKey.Builder
namespace(java.lang.String namespace)
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.ResourceKey.Builder
value(java.lang.String value)
Sets the key's value.
-
-
-
Method Detail
-
namespace
ResourceKey.Builder namespace(java.lang.String 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
default ResourceKey.Builder namespace(org.spongepowered.plugin.PluginContainer container)
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
ResourceKey.Builder value(java.lang.String value)
Sets the key's value.- Parameters:
value
- The value to use- Returns:
- This builder, for chaining
-
build
ResourceKey build() throws java.lang.IllegalStateException
Builds theResourceKey
.- Specified by:
build
in interfaceAbstractBuilder<ResourceKey>
- Specified by:
build
in interfaceBuildable.Builder<ResourceKey>
- Returns:
- The built resource key
- Throws:
java.lang.IllegalStateException
- Ifnamespace(String)
orvalue(String)
are not set.
-
-