Package org.spongepowered.api
Interface ResourceKey.Builder
-
- All Superinterfaces:
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 createResourceKeys.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ResourceKeybuild()Builds theResourceKey.ResourceKey.Buildernamespace(String namespace)Sets the key's namespace.default ResourceKey.Buildernamespace(org.spongepowered.plugin.PluginContainer container)Sets the key's namespace based on the providedPluginContainer's identifier.ResourceKey.Buildervalue(String value)Sets the key's value.
-
-
-
Method Detail
-
namespace
ResourceKey.Builder namespace(String namespace)
Sets the key's namespace.If using a
ResourceKey.MINECRAFT_NAMESPACEorResourceKey.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(String value)
Sets the key's value.- Parameters:
value- The value to use- Returns:
- This builder, for chaining
-
build
ResourceKey build() throws IllegalStateException
Builds theResourceKey.- Specified by:
buildin interfaceBuildable.Builder<ResourceKey>- Returns:
- The built resource key
- Throws:
IllegalStateException- Ifnamespace(String)orvalue(String)are not set.
-
-