Class MMetadata

java.lang.Object
com.io7m.montarre.api.MMetadata
All Implemented Interfaces:
MMetadataType, MPackageElementType

public final class MMetadata extends Object implements MMetadataType
Package metadata.
  • Method Details

    • names

      public MNamesType names()
      Specified by:
      names in interface MMetadataType
      Returns:
      The package name information
    • version

      public MVersion version()
      Specified by:
      version in interface MMetadataType
      Returns:
      The package version
    • javaInfo

      public MJavaInfoType javaInfo()
      Specified by:
      javaInfo in interface MMetadataType
      Returns:
      Information involving the Java runtime
    • description

      public MDescription description()
      Specified by:
      description in interface MMetadataType
      Returns:
      The package description
    • links

      public Set<MLink> links()
      Specified by:
      links in interface MMetadataType
      Returns:
      The various package links.
    • vendor

      public MVendor vendor()
      Specified by:
      vendor in interface MMetadataType
      Returns:
      The vendor
    • copying

      public MCopyingType copying()
      Specified by:
      copying in interface MMetadataType
      Returns:
      The copyright and license information
    • longDescriptions

      public List<MLongDescriptionType> longDescriptions()
      Specified by:
      longDescriptions in interface MMetadataType
      Returns:
      A long description of the application
    • longDescriptionsByLanguage

      public SortedMap<MLanguageCode, MLongDescriptionType> longDescriptionsByLanguage()
      A map of the long descriptions by language.
      Specified by:
      longDescriptionsByLanguage in interface MMetadataType
      Returns:
      The long descriptions by language
    • categories

      public Set<MCategoryName> categories()
      Specified by:
      categories in interface MMetadataType
      Returns:
      The application categories
    • applicationKind

      public MApplicationKind applicationKind()
      Specified by:
      applicationKind in interface MMetadataType
      Returns:
      The kind of the application
    • flatpak

      public MMetadataFlatpakType flatpak()
      Specified by:
      flatpak in interface MMetadataType
      Returns:
      The flatpak-specific metadata
    • withNames

      public final MMetadata withNames(MNamesType value)
      Copy the current immutable object by setting a value for the names attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for names
      Returns:
      A modified copy or the this object
    • withVersion

      public final MMetadata withVersion(MVersion value)
      Copy the current immutable object by setting a value for the version attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for version
      Returns:
      A modified copy or the this object
    • withJavaInfo

      public final MMetadata withJavaInfo(MJavaInfoType value)
      Copy the current immutable object by setting a value for the javaInfo attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for javaInfo
      Returns:
      A modified copy or the this object
    • withDescription

      public final MMetadata withDescription(MDescription value)
      Copy the current immutable object by setting a value for the description attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for description
      Returns:
      A modified copy or the this object
    • withLinks

      public final MMetadata withLinks(MLink... elements)
      Copy the current immutable object with elements that replace the content of links.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withLinks

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

      public final MMetadata withVendor(MVendor value)
      Copy the current immutable object by setting a value for the vendor attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for vendor
      Returns:
      A modified copy or the this object
    • withCopying

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

      public final MMetadata withLongDescriptions(MLongDescriptionType... elements)
      Copy the current immutable object with elements that replace the content of longDescriptions.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withLongDescriptions

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

      public final MMetadata withCategories(MCategoryName... elements)
      Copy the current immutable object with elements that replace the content of categories.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withCategories

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

      public final MMetadata withApplicationKind(MApplicationKind value)
      Copy the current immutable object by setting a value for the applicationKind attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for applicationKind
      Returns:
      A modified copy or the this object
    • withFlatpak

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

      public boolean equals(Object another)
      This instance is equal to all instances of MMetadata 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: names, version, javaInfo, description, links, vendor, copying, longDescriptions, longDescriptionsByLanguage, categories, applicationKind, flatpak.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static MMetadata.Builder builder()
      Creates a builder for MMetadata.
      MMetadata.builder()
         .setNames(com.io7m.montarre.api.MNamesType) // required names
         .setVersion(com.io7m.montarre.api.MVersion) // required version
         .setJavaInfo(com.io7m.montarre.api.MJavaInfoType) // required javaInfo
         .setDescription(com.io7m.montarre.api.MDescription) // required description
         .addLinks|addAllLinks(com.io7m.montarre.api.MLink) // links elements
         .setVendor(com.io7m.montarre.api.MVendor) // required vendor
         .setCopying(com.io7m.montarre.api.MCopyingType) // required copying
         .addLongDescriptions|addAllLongDescriptions(com.io7m.montarre.api.MLongDescriptionType) // longDescriptions elements
         .addCategories|addAllCategories(com.io7m.montarre.api.MCategoryName) // categories elements
         .setApplicationKind(com.io7m.montarre.api.MApplicationKind) // required applicationKind
         .setFlatpak(com.io7m.montarre.api.MMetadataFlatpakType) // optional flatpak
         .build();
      
      Returns:
      A new MMetadata builder