Class MManifest

java.lang.Object
com.io7m.montarre.api.MManifest
All Implemented Interfaces:
MManifestType, MPackageElementType

public final class MManifest extends Object implements MManifestType
A package manifest.
  • Method Details

    • items

      public List<MManifestItemType> items()
      Specified by:
      items in interface MManifestType
      Returns:
      The manifest items
    • itemsMap

      public Map<MFileName, MManifestItemType> itemsMap()
      Specified by:
      itemsMap in interface MManifestType
      Returns:
      The manifest items as a map (by file name)
    • withItems

      public final MManifest withItems(MManifestItemType... elements)
      Copy the current immutable object with elements that replace the content of items.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withItems

      public final MManifest withItems(Iterable<? extends MManifestItemType> elements)
      Copy the current immutable object with elements that replace the content of items. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of items elements to set
      Returns:
      A modified copy or this if not changed
    • equals

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

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

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

      public static MManifest.Builder builder()
      Creates a builder for MManifest.
      MManifest.builder()
         .addItems|addAllItems(com.io7m.montarre.api.MManifestItemType) // items elements
         .build();
      
      Returns:
      A new MManifest builder