Package com.io7m.jade.api
Class ApplicationDirectoryConfiguration
java.lang.Object
com.io7m.jade.api.ApplicationDirectoryConfiguration
- All Implemented Interfaces:
ApplicationDirectoryConfigurationType
public final class ApplicationDirectoryConfiguration
extends Object
implements ApplicationDirectoryConfigurationType
The type of application directory configurations.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Builds instances of typeApplicationDirectoryConfiguration
. -
Method Summary
Modifier and TypeMethodDescriptionThe name of the application.builder()
Creates a builder forApplicationDirectoryConfiguration
.copyOf
(ApplicationDirectoryConfigurationType instance) Creates an immutable copy of aApplicationDirectoryConfigurationType
value.boolean
This instance is equal to all instances ofApplicationDirectoryConfiguration
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:applicationName
,portablePropertyName
,overridePropertyName
.The name of a system property which, if present, will be used to specify a fixed base directory against which all other application directories will be resolved.The name of a system property which, if present, will be used to enable portable mode.toString()
Prints the immutable valueApplicationDirectoryConfiguration
with attribute values.withApplicationName
(String value) Copy the current immutable object by setting a value for theapplicationName
attribute.withOverridePropertyName
(String value) Copy the current immutable object by setting a present value for the optionaloverridePropertyName
attribute.withOverridePropertyName
(Optional<String> optional) Copy the current immutable object by setting an optional value for theoverridePropertyName
attribute.withPortablePropertyName
(String value) Copy the current immutable object by setting a present value for the optionalportablePropertyName
attribute.withPortablePropertyName
(Optional<String> optional) Copy the current immutable object by setting an optional value for theportablePropertyName
attribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.io7m.jade.api.ApplicationDirectoryConfigurationType
checkPreconditions
-
Method Details
-
applicationName
The name of the application. The name is used in paths and must be valid according toApplicationNames.isValid(String)
.- Specified by:
applicationName
in interfaceApplicationDirectoryConfigurationType
- Returns:
- The name of the application.
-
portablePropertyName
The name of a system property which, if present, will be used to enable portable mode. If the system property is present, and can be parsed as atrue
value, then portable mode will be enabled and all calculated application paths will be relative to the application's working directory.- Specified by:
portablePropertyName
in interfaceApplicationDirectoryConfigurationType
- Returns:
- A property name to enable portable mode
-
overridePropertyName
The name of a system property which, if present, will be used to specify a fixed base directory against which all other application directories will be resolved. If the system property is present, the contents will be used directory as the name of a base directory, and all calculated application paths will be relative to this directory. Paths exactly equivalent to those produced by portable mode can be obtained by specifying the application's working directory in the system property.- Specified by:
overridePropertyName
in interfaceApplicationDirectoryConfigurationType
- Returns:
- A property name to enable portable mode
-
withApplicationName
Copy the current immutable object by setting a value for theapplicationName
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for applicationName- Returns:
- A modified copy of the
this
object
-
withPortablePropertyName
Copy the current immutable object by setting a present value for the optionalportablePropertyName
attribute.- Parameters:
value
- The value for portablePropertyName- Returns:
- A modified copy of
this
object
-
withPortablePropertyName
Copy the current immutable object by setting an optional value for theportablePropertyName
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for portablePropertyName- Returns:
- A modified copy of
this
object
-
withOverridePropertyName
Copy the current immutable object by setting a present value for the optionaloverridePropertyName
attribute.- Parameters:
value
- The value for overridePropertyName- Returns:
- A modified copy of
this
object
-
withOverridePropertyName
Copy the current immutable object by setting an optional value for theoverridePropertyName
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for overridePropertyName- Returns:
- A modified copy of
this
object
-
equals
This instance is equal to all instances ofApplicationDirectoryConfiguration
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:applicationName
,portablePropertyName
,overridePropertyName
. -
toString
Prints the immutable valueApplicationDirectoryConfiguration
with attribute values. -
copyOf
public static ApplicationDirectoryConfiguration copyOf(ApplicationDirectoryConfigurationType instance) Creates an immutable copy of aApplicationDirectoryConfigurationType
value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance
- The instance to copy- Returns:
- A copied immutable ApplicationDirectoryConfiguration instance
-
builder
Creates a builder forApplicationDirectoryConfiguration
.ApplicationDirectoryConfiguration.builder() .setApplicationName(String) // required
applicationName
.setPortablePropertyName(String) // optionalportablePropertyName
.setOverridePropertyName(String) // optionaloverridePropertyName
.build();- Returns:
- A new ApplicationDirectoryConfiguration builder
-