Class ServiceEnvironment
java.lang.Object
eu.cloudnetservice.driver.service.ServiceEnvironment
Represents an environment a service can run in. The environment for example decides which application file gets
chosen when starting a service. Environments are grouped in a service environment type and both must be registered on
a node which picks up a service using the environment.
- Since:
- 4.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder for a service environment. -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedServiceEnvironment(@NonNull String name, @NonNull String environmentType) Constructs a new service environment instance. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Constructs a new builder instance for a service environment.builder(@NonNull ServiceEnvironment environment) Constructs a new builder instance for a service environment, copying the properties of the given environment into the builder first.clone()Get the name of the environment type which is associated with this environment.name()Get the unique name identifier of this object in the related scope.
-
Field Details
-
name
-
environmentType
-
-
Constructor Details
-
ServiceEnvironment
protected ServiceEnvironment(@NonNull @NonNull String name, @NonNull @NonNull String environmentType) Constructs a new service environment instance.- Parameters:
name- the name of the environment.environmentType- the environment type which is associated with this environment.- Throws:
NullPointerException- if the given name or environment type is null.
-
-
Method Details
-
builder
Constructs a new builder instance for a service environment.- Returns:
- a service environment builder.
-
builder
@NonNull public static @NonNull ServiceEnvironment.Builder builder(@NonNull @NonNull ServiceEnvironment environment) Constructs a new builder instance for a service environment, copying the properties of the given environment into the builder first.When calling build directly after constructing a builder using this method, it will result in an environment which is equal but not the same as the given one.
- Parameters:
environment- the environment to copy the properties from.- Returns:
- a new builder for a service environment holding the same properties as the given environment.
- Throws:
NullPointerException- if the given environment is null.
-
name
-
environmentType
-
clone
-