Package com.io7m.waxmill.parser.api

# Class WXMParseError.Builder

java.lang.Object
com.io7m.waxmill.parser.api.WXMParseError.Builder

Enclosing class:
  WXMParseError

    public static final class WXMParseError.Builder
    extends java.lang.Object

Builds instances of type `WXMParseError`. 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
  --- | --- | ---
  `WXMParseError` | `build()` | Builds a new `WXMParseError`.
  `WXMParseError.Builder` | `from​(WXMParseErrorType instance)` | Fill a builder with attribute values from the provided `WXMParseErrorType` instance.
  `WXMParseError.Builder` | `setException​(java.lang.Exception exception)` | Initializes the optional value `exception` to exception.
  `WXMParseError.Builder` | `setException​(java.util.Optional<? extends java.lang.Exception> exception)` | Initializes the optional value `exception` to exception.
  `WXMParseError.Builder` | `setLexical​(com.io7m.jlexing.core.LexicalPosition<java.net.URI> lexical)` | Initializes the value for the `lexical` attribute.
  `WXMParseError.Builder` | `setMessage​(java.lang.String message)` | Initializes the value for the `message` attribute.
  `WXMParseError.Builder` | `setSeverity​(WXMParseErrorType.Severity severity)` | Initializes the value for the `severity` attribute.

  ### Methods inherited from class java.lang.Object

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

- ## Method Details

  - ### from

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

  - ### setLexical

    public final WXMParseError.Builder setLexical​(com.io7m.jlexing.core.LexicalPosition<java.net.URI> lexical)
    Initializes the value for the `lexical` attribute.
    Parameters:
      `lexical` - The value for lexical
    Returns:
      `this` builder for use in a chained invocation

  - ### setSeverity

    public final WXMParseError.Builder setSeverity​(WXMParseErrorType.Severity severity)
    Initializes the value for the `severity` attribute.
    Parameters:
      `severity` - The value for severity
    Returns:
      `this` builder for use in a chained invocation

  - ### setMessage

    public final WXMParseError.Builder setMessage​(java.lang.String message)
    Initializes the value for the `message` attribute.
    Parameters:
      `message` - The value for message
    Returns:
      `this` builder for use in a chained invocation

  - ### setException

    public final WXMParseError.Builder setException​(java.lang.Exception exception)
    Initializes the optional value `exception` to exception.
    Parameters:
      `exception` - The value for exception
    Returns:
      `this` builder for chained invocation

  - ### setException

    public final WXMParseError.Builder setException​(java.util.Optional<? extends java.lang.Exception> exception)
    Initializes the optional value `exception` to exception.
    Parameters:
      `exception` - The value for exception
    Returns:
      `this` builder for use in a chained invocation

  - ### build

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