Class MCopying

java.lang.Object
com.io7m.montarre.api.MCopying
All Implemented Interfaces:
MCopyingType

public final class MCopying extends Object implements MCopyingType
Copyright and license information.
  • Method Details

    • license

      public String license()
      Specified by:
      license in interface MCopyingType
      Returns:
      An SPDX license identifier
    • copyright

      public String copyright()
      Specified by:
      copyright in interface MCopyingType
      Returns:
      The single-line package copyright string
    • withLicense

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

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

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

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

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

      public static MCopying.Builder builder()
      Creates a builder for MCopying.
       MCopying.builder()
          .setLicense(String) // required license
          .setCopyright(String) // required copyright
          .build();
       
      Returns:
      A new MCopying builder