Class RuntimeDescription.Builder

  • Enclosing class:
    RuntimeDescription

    public static final class RuntimeDescription.Builder
    extends java.lang.Object
    Builds instances of type RuntimeDescription. 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 Detail

      • from

        public final RuntimeDescription.Builder from​(RuntimeDescriptionType instance)
        Fill a builder with attribute values from the provided RuntimeDescriptionType instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.
        Parameters:
        instance - The instance from which to copy values
        Returns:
        this builder for use in a chained invocation
      • setRepository

        public final RuntimeDescription.Builder setRepository​(java.net.URI repository)
        Initializes the value for the repository attribute.
        Parameters:
        repository - The value for repository
        Returns:
        this builder for use in a chained invocation
      • setVersion

        public final RuntimeDescription.Builder setVersion​(RuntimeVersion version)
        Initializes the value for the version attribute.
        Parameters:
        version - The value for version
        Returns:
        this builder for use in a chained invocation
      • setPlatform

        public final RuntimeDescription.Builder setPlatform​(java.lang.String platform)
        Initializes the value for the platform attribute.
        Parameters:
        platform - The value for platform
        Returns:
        this builder for use in a chained invocation
      • setArchitecture

        public final RuntimeDescription.Builder setArchitecture​(java.lang.String architecture)
        Initializes the value for the architecture attribute.
        Parameters:
        architecture - The value for architecture
        Returns:
        this builder for use in a chained invocation
      • setArchiveURI

        public final RuntimeDescription.Builder setArchiveURI​(java.net.URI archiveURI)
        Initializes the value for the archiveURI attribute.
        Parameters:
        archiveURI - The value for archiveURI
        Returns:
        this builder for use in a chained invocation
      • setArchiveSize

        public final RuntimeDescription.Builder setArchiveSize​(long archiveSize)
        Initializes the value for the archiveSize attribute.
        Parameters:
        archiveSize - The value for archiveSize
        Returns:
        this builder for use in a chained invocation
      • setArchiveHash

        public final RuntimeDescription.Builder setArchiveHash​(RuntimeHash archiveHash)
        Initializes the value for the archiveHash attribute.
        Parameters:
        archiveHash - The value for archiveHash
        Returns:
        this builder for use in a chained invocation
      • setVm

        public final RuntimeDescription.Builder setVm​(java.lang.String vm)
        Initializes the value for the vm attribute.
        Parameters:
        vm - The value for vm
        Returns:
        this builder for use in a chained invocation
      • setBuild

        public final RuntimeDescription.Builder setBuild​(RuntimeBuild build)
        Initializes the optional value build to build.
        Parameters:
        build - The value for build
        Returns:
        this builder for chained invocation
      • setBuild

        public final RuntimeDescription.Builder setBuild​(java.util.Optional<? extends RuntimeBuild> build)
        Initializes the optional value build to build.
        Parameters:
        build - The value for build
        Returns:
        this builder for use in a chained invocation
      • addTags

        public final RuntimeDescription.Builder addTags​(java.lang.String element)
        Adds one element to tags set.
        Parameters:
        element - A tags element
        Returns:
        this builder for use in a chained invocation
      • addTags

        public final RuntimeDescription.Builder addTags​(java.lang.String... elements)
        Adds elements to tags set.
        Parameters:
        elements - An array of tags elements
        Returns:
        this builder for use in a chained invocation
      • setTags

        public final RuntimeDescription.Builder setTags​(java.lang.Iterable<java.lang.String> elements)
        Sets or replaces all elements for tags set.
        Parameters:
        elements - An iterable of tags elements
        Returns:
        this builder for use in a chained invocation
      • addAllTags

        public final RuntimeDescription.Builder addAllTags​(java.lang.Iterable<java.lang.String> elements)
        Adds elements to tags set.
        Parameters:
        elements - An iterable of tags elements
        Returns:
        this builder for use in a chained invocation
      • build

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