Record Class ProcessConfiguration
java.lang.Object
java.lang.Record
eu.cloudnetservice.driver.service.ProcessConfiguration
- Record Components:
environment- the environment of the task / service this configuration belongs to.maxHeapMemorySize- the maximum amount of heap (in MB) a service is allowed to use.jvmOptions- the jvm options to apply to the process, for example the garbage collector.processParameters- the process parameters to apply after the actual command line, for example --dev.environmentVariables- the environment variables to apply to the service environment.
- All Implemented Interfaces:
Cloneable
public record ProcessConfiguration(@NonNull String environment, int maxHeapMemorySize, @Unmodifiable @NonNull List<String> jvmOptions, @Unmodifiable @NonNull List<String> processParameters, @Unmodifiable @NonNull Map<String,String> environmentVariables)
extends Record
implements Cloneable
Holds the most common options to configure any process started and managed by CloudNet.
- Since:
- 4.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents a builder for a process configuration. -
Field Summary
FieldsModifier and TypeFieldDescriptionThe field for theenvironmentrecord component.private final @Unmodifiable @NonNull Map<String, String> The field for theenvironmentVariablesrecord component.private final @Unmodifiable @NonNull List<String> The field for thejvmOptionsrecord component.private final intThe field for themaxHeapMemorySizerecord component.private final @Unmodifiable @NonNull List<String> The field for theprocessParametersrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionProcessConfiguration(@NonNull String environment, int maxHeapMemorySize, @Unmodifiable @NonNull List<String> jvmOptions, @Unmodifiable @NonNull List<String> processParameters, @Unmodifiable @NonNull Map<String, String> environmentVariables) Creates an instance of aProcessConfigurationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Constructs a new builder for a process configuration.builder(@NonNull ProcessConfiguration configuration) Constructs a new builder for a process configuration copying the properties from the given configuration into the builder.clone()Returns the value of theenvironmentrecord component.Returns the value of theenvironmentVariablesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thejvmOptionsrecord component.intReturns the value of themaxHeapMemorySizerecord component.Returns the value of theprocessParametersrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
environment
The field for theenvironmentrecord component. -
maxHeapMemorySize
private final int maxHeapMemorySizeThe field for themaxHeapMemorySizerecord component. -
jvmOptions
The field for thejvmOptionsrecord component. -
processParameters
The field for theprocessParametersrecord component. -
environmentVariables
The field for theenvironmentVariablesrecord component.
-
-
Constructor Details
-
ProcessConfiguration
public ProcessConfiguration(@NonNull @NonNull String environment, int maxHeapMemorySize, @NonNull @Unmodifiable @NonNull List<String> jvmOptions, @NonNull @Unmodifiable @NonNull List<String> processParameters, @NonNull @Unmodifiable @NonNull Map<String, String> environmentVariables) Creates an instance of aProcessConfigurationrecord class.- Parameters:
environment- the value for theenvironmentrecord componentmaxHeapMemorySize- the value for themaxHeapMemorySizerecord componentjvmOptions- the value for thejvmOptionsrecord componentprocessParameters- the value for theprocessParametersrecord componentenvironmentVariables- the value for theenvironmentVariablesrecord component
-
-
Method Details
-
builder
Constructs a new builder for a process configuration.- Returns:
- a new builder for a process configuration.
-
builder
@NonNull public static @NonNull ProcessConfiguration.Builder builder(@NonNull @NonNull ProcessConfiguration configuration) Constructs a new builder for a process configuration copying the properties from the given configuration into the builder. This means that calling build after creating the builder using this method will result in a new process configuration which is equal to the given configuration.- Parameters:
configuration- the configuration to copy the properties of.- Returns:
- a new builder for a process configuration.
- Throws:
NullPointerException- if the given process configuration is null.
-
clone
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
environment
Returns the value of theenvironmentrecord component.- Returns:
- the value of the
environmentrecord component
-
maxHeapMemorySize
public int maxHeapMemorySize()Returns the value of themaxHeapMemorySizerecord component.- Returns:
- the value of the
maxHeapMemorySizerecord component
-
jvmOptions
Returns the value of thejvmOptionsrecord component.- Returns:
- the value of the
jvmOptionsrecord component
-
processParameters
Returns the value of theprocessParametersrecord component.- Returns:
- the value of the
processParametersrecord component
-
environmentVariables
Returns the value of theenvironmentVariablesrecord component.- Returns:
- the value of the
environmentVariablesrecord component
-