Package com.io7m.smfj.parser.api
Class SMFParseWarning.Builder
- java.lang.Object
-
- com.io7m.smfj.parser.api.SMFParseWarning.Builder
-
- Enclosing class:
- SMFParseWarning
public static final class SMFParseWarning.Builder extends java.lang.ObjectBuilds instances of typeSMFParseWarning. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis 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 SMFParseWarningbuild()Builds a newSMFParseWarning.SMFParseWarning.Builderfrom(SMFWarningType instance)Fill a builder with attribute values from the providedcom.io7m.smfj.core.SMFWarningTypeinstance.SMFParseWarning.Builderfrom(SMFParseWarningType instance)Fill a builder with attribute values from the providedcom.io7m.smfj.parser.api.SMFParseWarningTypeinstance.SMFParseWarning.BuildersetException(java.lang.Exception exception)Initializes the optional valueexceptionto exception.SMFParseWarning.BuildersetException(java.util.Optional<? extends java.lang.Exception> exception)Initializes the optional valueexceptionto exception.SMFParseWarning.BuildersetLexical(com.io7m.jlexing.core.LexicalPosition<java.net.URI> lexical)Initializes the value for thelexicalattribute.SMFParseWarning.BuildersetMessage(java.lang.String message)Initializes the value for themessageattribute.
-
-
-
Method Detail
-
from
public final SMFParseWarning.Builder from(SMFWarningType instance)
Fill a builder with attribute values from the providedcom.io7m.smfj.core.SMFWarningTypeinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
public final SMFParseWarning.Builder from(SMFParseWarningType instance)
Fill a builder with attribute values from the providedcom.io7m.smfj.parser.api.SMFParseWarningTypeinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
setLexical
public final SMFParseWarning.Builder setLexical(com.io7m.jlexing.core.LexicalPosition<java.net.URI> lexical)
Initializes the value for thelexicalattribute.- Parameters:
lexical- The value for lexical- Returns:
thisbuilder for use in a chained invocation
-
setMessage
public final SMFParseWarning.Builder setMessage(java.lang.String message)
Initializes the value for themessageattribute.- Parameters:
message- The value for message- Returns:
thisbuilder for use in a chained invocation
-
setException
public final SMFParseWarning.Builder setException(java.lang.Exception exception)
Initializes the optional valueexceptionto exception.- Parameters:
exception- The value for exception- Returns:
thisbuilder for chained invocation
-
setException
public final SMFParseWarning.Builder setException(java.util.Optional<? extends java.lang.Exception> exception)
Initializes the optional valueexceptionto exception.- Parameters:
exception- The value for exception- Returns:
thisbuilder for use in a chained invocation
-
build
public SMFParseWarning build()
Builds a newSMFParseWarning.- Returns:
- An immutable instance of SMFParseWarning
- Throws:
java.lang.IllegalStateException- if any required attributes are missing
-
-