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.
  • Method Details

    • applicationName

      public String applicationName()
      The name of the application. The name is used in paths and must be valid according to ApplicationNames.isValid(String).
      Specified by:
      applicationName in interface ApplicationDirectoryConfigurationType
      Returns:
      The name of the application.
    • portablePropertyName

      public Optional<String> 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 a true 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 interface ApplicationDirectoryConfigurationType
      Returns:
      A property name to enable portable mode
    • overridePropertyName

      public Optional<String> 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 interface ApplicationDirectoryConfigurationType
      Returns:
      A property name to enable portable mode
    • withApplicationName

      public final ApplicationDirectoryConfiguration withApplicationName(String value)
      Copy the current immutable object by setting a value for the applicationName attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for applicationName
      Returns:
      A modified copy of the this object
    • withPortablePropertyName

      public final ApplicationDirectoryConfiguration withPortablePropertyName(String value)
      Copy the current immutable object by setting a present value for the optional portablePropertyName attribute.
      Parameters:
      value - The value for portablePropertyName
      Returns:
      A modified copy of this object
    • withPortablePropertyName

      public final ApplicationDirectoryConfiguration withPortablePropertyName(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the portablePropertyName attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for portablePropertyName
      Returns:
      A modified copy of this object
    • withOverridePropertyName

      public final ApplicationDirectoryConfiguration withOverridePropertyName(String value)
      Copy the current immutable object by setting a present value for the optional overridePropertyName attribute.
      Parameters:
      value - The value for overridePropertyName
      Returns:
      A modified copy of this object
    • withOverridePropertyName

      public final ApplicationDirectoryConfiguration withOverridePropertyName(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the overridePropertyName attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for overridePropertyName
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of ApplicationDirectoryConfiguration that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: applicationName, portablePropertyName, overridePropertyName.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value ApplicationDirectoryConfiguration with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      Creates an immutable copy of a ApplicationDirectoryConfigurationType 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 for ApplicationDirectoryConfiguration.
       ApplicationDirectoryConfiguration.builder()
          .setApplicationName(String) // required applicationName
          .setPortablePropertyName(String) // optional portablePropertyName
          .setOverridePropertyName(String) // optional overridePropertyName
          .build();
       
      Returns:
      A new ApplicationDirectoryConfiguration builder