Class MEARuntime.Builder

java.lang.Object
com.io7m.montarre.adoptium.MEARuntime.Builder
Enclosing class:
MEARuntime

public static final class MEARuntime.Builder extends Object
Builds instances of type MEARuntime. Initialize attributes and then invoke the build() method to create an immutable instance.

Builder is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.

  • Method Details

    • from

      public final MEARuntime.Builder from(MEARuntimeType instance)
      Fill a builder with attribute values from the provided MEARuntimeType instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • setHash

      public final MEARuntime.Builder setHash(MHash hash)
      Initializes the value for the hash attribute.
      Parameters:
      hash - The value for hash
      Returns:
      this builder for use in a chained invocation
    • setDownloadLink

      public final MEARuntime.Builder setDownloadLink(URI downloadLink)
      Initializes the value for the downloadLink attribute.
      Parameters:
      downloadLink - The value for downloadLink
      Returns:
      this builder for use in a chained invocation
    • setSize

      public final MEARuntime.Builder setSize(long size)
      Initializes the value for the size attribute.
      Parameters:
      size - The value for size
      Returns:
      this builder for use in a chained invocation
    • setArchitecture

      public final MEARuntime.Builder setArchitecture(MArchitectureName architecture)
      Initializes the value for the architecture attribute.
      Parameters:
      architecture - The value for architecture
      Returns:
      this builder for use in a chained invocation
    • setOperatingSystem

      public final MEARuntime.Builder setOperatingSystem(MOperatingSystemName operatingSystem)
      Initializes the value for the operatingSystem attribute.
      Parameters:
      operatingSystem - The value for operatingSystem
      Returns:
      this builder for use in a chained invocation
    • setFormat

      public final MEARuntime.Builder setFormat(MArchiveFormat format)
      Initializes the value for the format attribute.
      Parameters:
      format - The value for format
      Returns:
      this builder for use in a chained invocation
    • setVersion

      public final MEARuntime.Builder setVersion(Runtime.Version version)
      Initializes the value for the version attribute.
      Parameters:
      version - The value for version
      Returns:
      this builder for use in a chained invocation
    • build

      public MEARuntime build()
      Builds a new MEARuntime.
      Returns:
      An immutable instance of MEARuntime
      Throws:
      IllegalStateException - if any required attributes are missing