# Class MJavaInfo.Builder

java.lang.Object
com.io7m.montarre.api.MJavaInfo.Builder

Enclosing class:
  `MJavaInfo`

public static final class MJavaInfo.Builder extends Object
Builds instances of type `MJavaInfo`. 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 Summary

  Modifier and Type
  Method
  Description
  `final MJavaInfo.Builder`
  `addAllExtraOptions(Iterable<String> elements)`
  Adds elements to `extraOptions` list.
  `final MJavaInfo.Builder`
  `addAllNativeAccessModules(Iterable<String> elements)`
  Adds elements to `nativeAccessModules` set.
  `final MJavaInfo.Builder`
  `addExtraOptions(String element)`
  Adds one element to `extraOptions` list.
  `final MJavaInfo.Builder`
  `addExtraOptions(String... elements)`
  Adds elements to `extraOptions` list.
  `final MJavaInfo.Builder`
  `addNativeAccessModules(String element)`
  Adds one element to `nativeAccessModules` set.
  `final MJavaInfo.Builder`
  `addNativeAccessModules(String... elements)`
  Adds elements to `nativeAccessModules` set.
  `MJavaInfo`
  `build()`
  Builds a new `MJavaInfo`.
  `final MJavaInfo.Builder`
  `from(MJavaInfoType instance)`
  Fill a builder with attribute values from the provided `MJavaInfoType` instance.
  `final MJavaInfo.Builder`
  `setExtraOptions(Iterable<String> elements)`
  Sets or replaces all elements for `extraOptions` list.
  `final MJavaInfo.Builder`
  `setMainModule(String mainModule)`
  Initializes the value for the `mainModule` attribute.
  `final MJavaInfo.Builder`
  `setNativeAccessModules(Iterable<String> elements)`
  Sets or replaces all elements for `nativeAccessModules` set.
  `final MJavaInfo.Builder`
  `setRequiredJDKVersion(long requiredJDKVersion)`
  Initializes the value for the `requiredJDKVersion` attribute.
  `final MJavaInfo.Builder`
  `setRuntimeImageKind(MRuntimeImageKind runtimeImageKind)`
  Initializes the value for the `runtimeImageKind` attribute.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### from

    public final MJavaInfo.Builder from(MJavaInfoType instance)
    Fill a builder with attribute values from the provided `MJavaInfoType` 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

  - ### setRequiredJDKVersion

    public final MJavaInfo.Builder setRequiredJDKVersion(long requiredJDKVersion)
    Initializes the value for the `requiredJDKVersion` attribute.
    Parameters:
      `requiredJDKVersion` - The value for requiredJDKVersion
    Returns:
      `this` builder for use in a chained invocation

  - ### setMainModule

    public final MJavaInfo.Builder setMainModule(String mainModule)
    Initializes the value for the `mainModule` attribute.
    Parameters:
      `mainModule` - The value for mainModule
    Returns:
      `this` builder for use in a chained invocation

  - ### addExtraOptions

    public final MJavaInfo.Builder addExtraOptions(String element)
    Adds one element to `extraOptions` list.
    Parameters:
      `element` - A extraOptions element
    Returns:
      `this` builder for use in a chained invocation

  - ### addExtraOptions

    public final MJavaInfo.Builder addExtraOptions(String... elements)
    Adds elements to `extraOptions` list.
    Parameters:
      `elements` - An array of extraOptions elements
    Returns:
      `this` builder for use in a chained invocation

  - ### setExtraOptions

    public final MJavaInfo.Builder setExtraOptions(Iterable<String> elements)
    Sets or replaces all elements for `extraOptions` list.
    Parameters:
      `elements` - An iterable of extraOptions elements
    Returns:
      `this` builder for use in a chained invocation

  - ### addAllExtraOptions

    public final MJavaInfo.Builder addAllExtraOptions(Iterable<String> elements)
    Adds elements to `extraOptions` list.
    Parameters:
      `elements` - An iterable of extraOptions elements
    Returns:
      `this` builder for use in a chained invocation

  - ### addNativeAccessModules

    public final MJavaInfo.Builder addNativeAccessModules(String element)
    Adds one element to `nativeAccessModules` set.
    Parameters:
      `element` - A nativeAccessModules element
    Returns:
      `this` builder for use in a chained invocation

  - ### addNativeAccessModules

    public final MJavaInfo.Builder addNativeAccessModules(String... elements)
    Adds elements to `nativeAccessModules` set.
    Parameters:
      `elements` - An array of nativeAccessModules elements
    Returns:
      `this` builder for use in a chained invocation

  - ### setNativeAccessModules

    public final MJavaInfo.Builder setNativeAccessModules(Iterable<String> elements)
    Sets or replaces all elements for `nativeAccessModules` set.
    Parameters:
      `elements` - An iterable of nativeAccessModules elements
    Returns:
      `this` builder for use in a chained invocation

  - ### addAllNativeAccessModules

    public final MJavaInfo.Builder addAllNativeAccessModules(Iterable<String> elements)
    Adds elements to `nativeAccessModules` set.
    Parameters:
      `elements` - An iterable of nativeAccessModules elements
    Returns:
      `this` builder for use in a chained invocation

  - ### setRuntimeImageKind

    public final MJavaInfo.Builder setRuntimeImageKind(MRuntimeImageKind runtimeImageKind)
    Initializes the value for the `runtimeImageKind` attribute.

    If not set, this attribute will have a default value as returned by the initializer of `runtimeImageKind`.

    Parameters:
      `runtimeImageKind` - The value for runtimeImageKind
    Returns:
      `this` builder for use in a chained invocation

  - ### build

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