Class MNames

java.lang.Object
com.io7m.montarre.api.MNames
All Implemented Interfaces:
MNamesType

public final class MNames extends Object implements MNamesType
Name information.
  • Method Details

    • packageName

      public MPackageName packageName()
      Specified by:
      packageName in interface MNamesType
      Returns:
      The package name
    • humanName

      public String humanName()
      Specified by:
      humanName in interface MNamesType
      Returns:
      The humanly-readable application name
    • shortName

      public MShortName shortName()
      Specified by:
      shortName in interface MNamesType
      Returns:
      The package short name
    • id

      public UUID id()
      Specified by:
      id in interface MNamesType
      Returns:
      A name-based UUID from the package name
    • withPackageName

      public final MNames withPackageName(MPackageName value)
      Copy the current immutable object by setting a value for the packageName attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for packageName
      Returns:
      A modified copy or the this object
    • withHumanName

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

      public final MNames withShortName(MShortName value)
      Copy the current immutable object by setting a value for the shortName attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for shortName
      Returns:
      A modified copy or the this object
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of MNames 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: packageName, humanName, shortName, id.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static MNames copyOf(MNamesType instance)
      Creates an immutable copy of a MNamesType 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 MNames instance
    • builder

      public static MNames.Builder builder()
      Creates a builder for MNames.
      MNames.builder()
         .setPackageName(com.io7m.montarre.api.MPackageName) // required packageName
         .setHumanName(String) // optional humanName
         .setShortName(com.io7m.montarre.api.MShortName) // required shortName
         .build();
      
      Returns:
      A new MNames builder