Class RuntimeRepositoryDescription

java.lang.Object
com.io7m.coffeepick.runtime.RuntimeRepositoryDescription
All Implemented Interfaces:
RuntimeRepositoryDescriptionType

public final class RuntimeRepositoryDescription
extends java.lang.Object
implements RuntimeRepositoryDescriptionType
A repository of runtimes.
  • Method Details

    • id

      public java.net.URI id()
      Specified by:
      id in interface RuntimeRepositoryDescriptionType
      Returns:
      The unique ID of the repository
    • updated

      public java.util.Optional<java.time.OffsetDateTime> updated()
      Specified by:
      updated in interface RuntimeRepositoryDescriptionType
      Returns:
      The time of the last update of the repository
    • runtimes

      public java.util.Map<java.lang.String,​RuntimeDescription> runtimes()
      Specified by:
      runtimes in interface RuntimeRepositoryDescriptionType
      Returns:
      The runtimes available in the repository
    • branding

      public RuntimeRepositoryBranding branding()
      Specified by:
      branding in interface RuntimeRepositoryDescriptionType
      Returns:
      Branding information for the repository
    • withId

      public final RuntimeRepositoryDescription withId​(java.net.URI value)
      Copy the current immutable object by setting a value for the id attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for id
      Returns:
      A modified copy of the this object
    • withUpdated

      public final RuntimeRepositoryDescription withUpdated​(java.time.OffsetDateTime value)
      Copy the current immutable object by setting a present value for the optional updated attribute.
      Parameters:
      value - The value for updated
      Returns:
      A modified copy of this object
    • withUpdated

      public final RuntimeRepositoryDescription withUpdated​(java.util.Optional<? extends java.time.OffsetDateTime> optional)
      Copy the current immutable object by setting an optional value for the updated attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for updated
      Returns:
      A modified copy of this object
    • withRuntimes

      public final RuntimeRepositoryDescription withRuntimes​(java.util.Map<java.lang.String,​? extends RuntimeDescription> entries)
      Copy the current immutable object by replacing the runtimes map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      entries - The entries to be added to the runtimes map
      Returns:
      A modified copy of this object
    • withBranding

      public final RuntimeRepositoryDescription withBranding​(RuntimeRepositoryBranding value)
      Copy the current immutable object by setting a value for the branding attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for branding
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals​(java.lang.Object another)
      This instance is equal to all instances of RuntimeRepositoryDescription that have equal attribute values.
      Overrides:
      equals in class java.lang.Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: id, updated, runtimes, branding.
      Overrides:
      hashCode in class java.lang.Object
      Returns:
      hashCode value
    • toString

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

      Creates an immutable copy of a RuntimeRepositoryDescriptionType 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 RuntimeRepositoryDescription instance
    • builder

      public static RuntimeRepositoryDescription.Builder builder()
      Creates a builder for RuntimeRepositoryDescription.
       RuntimeRepositoryDescription.builder()
          .setId(java.net.URI) // required id
          .setUpdated(java.time.OffsetDateTime) // optional updated
          .putRuntimes|putAllRuntimes(String => RuntimeDescription) // runtimes mappings
          .setBranding(com.io7m.coffeepick.runtime.RuntimeRepositoryBranding) // required branding
          .build();
       
      Returns:
      A new RuntimeRepositoryDescription builder