Class MEARuntime

java.lang.Object
com.io7m.montarre.adoptium.MEARuntime
All Implemented Interfaces:
MEARuntimeType

public final class MEARuntime extends Object implements MEARuntimeType
An Adoptium runtime.
  • Method Details

    • hash

      public MHash hash()
      Specified by:
      hash in interface MEARuntimeType
      Returns:
      The checksum of the remote file
    • downloadLink

      public URI downloadLink()
      Specified by:
      downloadLink in interface MEARuntimeType
      Returns:
      The download link
    • size

      public long size()
      Specified by:
      size in interface MEARuntimeType
      Returns:
      The size of the remote file
    • architecture

      public MArchitectureName architecture()
      Specified by:
      architecture in interface MEARuntimeType
      Returns:
      The hardware architecture of the remote file
    • operatingSystem

      public MOperatingSystemName operatingSystem()
      Specified by:
      operatingSystem in interface MEARuntimeType
      Returns:
      The operating system of the remote file
    • format

      public MArchiveFormat format()
      Specified by:
      format in interface MEARuntimeType
      Returns:
      The format type
    • version

      public Runtime.Version version()
      Specified by:
      version in interface MEARuntimeType
      Returns:
      The runtime version
    • withHash

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

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

      public final MEARuntime withSize(long value)
      Copy the current immutable object by setting a value for the size attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for size
      Returns:
      A modified copy or the this object
    • withArchitecture

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

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

      public final MEARuntime withFormat(MArchiveFormat value)
      Copy the current immutable object by setting a value for the format attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for format
      Returns:
      A modified copy or the this object
    • withVersion

      public final MEARuntime withVersion(Runtime.Version 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
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of MEARuntime 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: hash, downloadLink, size, architecture, operatingSystem, format, version.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static MEARuntime.Builder builder()
      Creates a builder for MEARuntime.
      MEARuntime.builder()
         .setHash(com.io7m.montarre.api.MHash) // required hash
         .setDownloadLink(java.net.URI) // required downloadLink
         .setSize(long) // required size
         .setArchitecture(com.io7m.montarre.api.MArchitectureName) // required architecture
         .setOperatingSystem(com.io7m.montarre.api.MOperatingSystemName) // required operatingSystem
         .setFormat(com.io7m.montarre.api.MArchiveFormat) // required format
         .setVersion(Runtime.Version) // required version
         .build();
      
      Returns:
      A new MEARuntime builder