Class ServiceEnvironment.Builder
java.lang.Object
eu.cloudnetservice.driver.service.ServiceEnvironment.Builder
- Enclosing class:
ServiceEnvironment
A builder for a service environment.
- Since:
- 4.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a service environment instance based on this builder.Sets the name of the environment type which is associated with this environment.environmentType(@NonNull String environmentType) Sets the name of the environment type which is associated with this environment.Sets the name of the environment created by this builder.
-
Field Details
-
name
-
environmentType
-
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
name
Sets the name of the environment created by this builder.- Parameters:
name- the name of the environment.- Returns:
- the same instance as used to call the method, for chaining.
- Throws:
NullPointerException- if the given name is null.
-
environmentType
@NonNull public @NonNull ServiceEnvironment.Builder environmentType(@NonNull @NonNull String environmentType) Sets the name of the environment type which is associated with this environment. The environment type holds the information which are shared between all environments grouped by it, for example which configuration files need to be edited to start the service.- Parameters:
environmentType- the name of the environment type which is associated with this environment.- Returns:
- the same instance as used to call the method, for chaining.
- Throws:
NullPointerException- if the given environment type name is null.
-
environmentType
@NonNull public @NonNull ServiceEnvironment.Builder environmentType(@NonNull @NonNull ServiceEnvironmentType type) Sets the name of the environment type which is associated with this environment. The environment type holds the information which are shared between all environments grouped by it, for example which configuration files need to be edited to start the service.- Parameters:
type- the environment type which should be associated with this environment.- Returns:
- the same instance as used to call the method, for chaining.
- Throws:
NullPointerException- if the given environment type is null.
-
build
Builds a service environment instance based on this builder.- Returns:
- the created service environment.
- Throws:
NullPointerException- if no name or parent environment type was given.
-