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
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds 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 aApplicationDirectoryConfigurationTypevalue.booleanThis instance is equal to all instances ofApplicationDirectoryConfigurationthat have equal attribute values.inthashCode()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 valueApplicationDirectoryConfigurationwith attribute values.withApplicationName(String value) Copy the current immutable object by setting a value for theapplicationNameattribute.withOverridePropertyName(String value) Copy the current immutable object by setting a present value for the optionaloverridePropertyNameattribute.withOverridePropertyName(Optional<String> optional) Copy the current immutable object by setting an optional value for theoverridePropertyNameattribute.withPortablePropertyName(String value) Copy the current immutable object by setting a present value for the optionalportablePropertyNameattribute.withPortablePropertyName(Optional<String> optional) Copy the current immutable object by setting an optional value for theportablePropertyNameattribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:
applicationNamein 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 atruevalue, then portable mode will be enabled and all calculated application paths will be relative to the application's working directory.- Specified by:
portablePropertyNamein 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:
overridePropertyNamein interfaceApplicationDirectoryConfigurationType- Returns:
- A property name to enable portable mode
-
withApplicationName
Copy the current immutable object by setting a value for theapplicationNameattribute. 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
thisobject
-
withPortablePropertyName
Copy the current immutable object by setting a present value for the optionalportablePropertyNameattribute.- Parameters:
value- The value for portablePropertyName- Returns:
- A modified copy of
thisobject
-
withPortablePropertyName
Copy the current immutable object by setting an optional value for theportablePropertyNameattribute. 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
thisobject
-
withOverridePropertyName
Copy the current immutable object by setting a present value for the optionaloverridePropertyNameattribute.- Parameters:
value- The value for overridePropertyName- Returns:
- A modified copy of
thisobject
-
withOverridePropertyName
Copy the current immutable object by setting an optional value for theoverridePropertyNameattribute. 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
thisobject
-
equals
This instance is equal to all instances ofApplicationDirectoryConfigurationthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:applicationName,portablePropertyName,overridePropertyName. -
toString
Prints the immutable valueApplicationDirectoryConfigurationwith attribute values. -
copyOf
public static ApplicationDirectoryConfiguration copyOf(ApplicationDirectoryConfigurationType instance) Creates an immutable copy of aApplicationDirectoryConfigurationTypevalue. 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) // requiredapplicationName.setPortablePropertyName(String) // optionalportablePropertyName.setOverridePropertyName(String) // optionaloverridePropertyName.build();- Returns:
- A new ApplicationDirectoryConfiguration builder
-