Package com.io7m.smfj.parser.api
Class SMFParseError.Builder
- java.lang.Object
-
- com.io7m.smfj.parser.api.SMFParseError.Builder
-
- Enclosing class:
- SMFParseError
public static final class SMFParseError.Builder extends java.lang.Object
Builds instances of typeSMFParseError
. Initialize attributes and then invoke thebuild()
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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SMFParseError
build()
Builds a newSMFParseError
.SMFParseError.Builder
from(SMFErrorType instance)
Fill a builder with attribute values from the providedcom.io7m.smfj.core.SMFErrorType
instance.SMFParseError.Builder
from(SMFParseErrorType instance)
Fill a builder with attribute values from the providedcom.io7m.smfj.parser.api.SMFParseErrorType
instance.SMFParseError.Builder
setException(java.lang.Exception exception)
Initializes the optional valueexception
to exception.SMFParseError.Builder
setException(java.util.Optional<? extends java.lang.Exception> exception)
Initializes the optional valueexception
to exception.SMFParseError.Builder
setLexical(com.io7m.jlexing.core.LexicalPosition<java.net.URI> lexical)
Initializes the value for thelexical
attribute.SMFParseError.Builder
setMessage(java.lang.String message)
Initializes the value for themessage
attribute.
-
-
-
Method Detail
-
from
public final SMFParseError.Builder from(SMFParseErrorType instance)
Fill a builder with attribute values from the providedcom.io7m.smfj.parser.api.SMFParseErrorType
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
from
public final SMFParseError.Builder from(SMFErrorType instance)
Fill a builder with attribute values from the providedcom.io7m.smfj.core.SMFErrorType
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
setLexical
public final SMFParseError.Builder setLexical(com.io7m.jlexing.core.LexicalPosition<java.net.URI> lexical)
Initializes the value for thelexical
attribute.- Parameters:
lexical
- The value for lexical- Returns:
this
builder for use in a chained invocation
-
setMessage
public final SMFParseError.Builder setMessage(java.lang.String message)
Initializes the value for themessage
attribute.- Parameters:
message
- The value for message- Returns:
this
builder for use in a chained invocation
-
setException
public final SMFParseError.Builder setException(java.lang.Exception exception)
Initializes the optional valueexception
to exception.- Parameters:
exception
- The value for exception- Returns:
this
builder for chained invocation
-
setException
public final SMFParseError.Builder setException(java.util.Optional<? extends java.lang.Exception> exception)
Initializes the optional valueexception
to exception.- Parameters:
exception
- The value for exception- Returns:
this
builder for use in a chained invocation
-
build
public SMFParseError build()
Builds a newSMFParseError
.- Returns:
- An immutable instance of SMFParseError
- Throws:
java.lang.IllegalStateException
- if any required attributes are missing
-
-