Interface ServerWorldProperties.LoadOptions
- Enclosing interface:
ServerWorldProperties
ServerWorldProperties
.
Each load options
can define
multiple operations at once that will be exhausted
until one of them succeeds.
The operations will be consumed in the following order:
- Get
- Load
- Create
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
A builder to createServerWorldProperties.LoadOptions
.static interface
static interface
static interface
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
create
(WorldArchetype worldArchetype) Create a newServerWorldProperties
with the givenWorldArchetype
but do not attempt to load it from disk or use the already loaded instance.create
(WorldArchetype worldArchetype, Consumer<ServerWorldProperties> createCallback) Create a newServerWorldProperties
with the givenWorldArchetype
but do not attempt to load it from disk or use the already loaded instance.Gets thecreation operation
for this option.get()
Get the already loadedServerWorldProperties
instance but do not attempt load it from the disk or create it.get
(Consumer<ServerWorldProperties> getCallback) Get the already loadedServerWorldProperties
instance but do not attempt load it from the disk or create it.Gets theget operation
for this option.Get the already loadedServerWorldProperties
or attempt to load it from disk but do not create a new one.getOrLoad
(Consumer<ServerWorldProperties> getCallback, Consumer<ServerWorldProperties> loadCallback) Get the already loadedServerWorldProperties
or attempt to load it from disk but do not create a new one.load()
Load a newServerWorldProperties
from disk but do not attempt to use the already loaded instance or to create a new one.load
(Consumer<ServerWorldProperties> loadCallback) Load a newServerWorldProperties
from disk but do not attempt to use the already loaded instance or to create a new one.Gets theload operation
for this option.
-
Method Details
-
builder
-
load
Load a newServerWorldProperties
from disk but do not attempt to use the already loaded instance or to create a new one.The operation fails if properties could not be loaded from disk.
- Returns:
- The load options.
-
load
Load a newServerWorldProperties
from disk but do not attempt to use the already loaded instance or to create a new one.The operation fails if properties could not be loaded from disk.
- Parameters:
loadCallback
- The consumer to call after successful load operation for additional configuration.- Returns:
- The load options.
-
get
Get the already loadedServerWorldProperties
instance but do not attempt load it from the disk or create it.The operation fails if properties were not already loaded.
- Returns:
- The load options.
-
get
Get the already loadedServerWorldProperties
instance but do not attempt load it from the disk or create it.The operation fails if properties were not already loaded.
- Parameters:
getCallback
- The consumer to call after successful get operation for additional configuration.- Returns:
- The load options.
-
getOrLoad
Get the already loadedServerWorldProperties
or attempt to load it from disk but do not create a new one.The operation fails if properties were not loaded nor could it be loaded from disk.
- Returns:
- The load options.
-
getOrLoad
static ServerWorldProperties.LoadOptions getOrLoad(Consumer<ServerWorldProperties> getCallback, Consumer<ServerWorldProperties> loadCallback) Get the already loadedServerWorldProperties
or attempt to load it from disk but do not create a new one.The operation fails if properties were not loaded nor could it be loaded from disk.
- Parameters:
getCallback
- The consumer to call after successful get operation for additional configuration.loadCallback
- The consumer to call after successful load operation for additional configuration.- Returns:
- The load options.
-
create
Create a newServerWorldProperties
with the givenWorldArchetype
but do not attempt to load it from disk or use the already loaded instance.The operation fails if properties could not be created.
- Parameters:
worldArchetype
- The archetype to use.- Returns:
- The load options.
-
create
static ServerWorldProperties.LoadOptions create(WorldArchetype worldArchetype, Consumer<ServerWorldProperties> createCallback) Create a newServerWorldProperties
with the givenWorldArchetype
but do not attempt to load it from disk or use the already loaded instance.The operation fails if properties could not be created.
- Parameters:
worldArchetype
- The archetype to use.createCallback
- The consumer to call after successful creation for additional configuration.- Returns:
- The load options.
-
getOperation
Optional<ServerWorldProperties.LoadOptions.GetOperation> getOperation()Gets theget operation
for this option.If not present, the operation should fail on get.
- Returns:
- The option when found, if present.
-
loadOperation
Optional<ServerWorldProperties.LoadOptions.LoadOperation> loadOperation()Gets theload operation
for this option.If not present, the operation should fail on load.
- Returns:
- The option when found, if present.
-
createOperation
Optional<ServerWorldProperties.LoadOptions.CreateOperation> createOperation()Gets thecreation operation
for this option.If not present, the operation should fail on creation.
- Returns:
- The operation when created, if present.
-