Package com.io7m.changelog.parser.api
Class CParseError.Builder
java.lang.Object
com.io7m.changelog.parser.api.CParseError.Builder
- Enclosing class:
CParseError
Builds instances of type
CParseError.
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 TypeMethodDescriptionbuild()Builds a newCParseError.final CParseError.Builderfrom(CParseErrorType instance) Fill a builder with attribute values from the providedCParseErrorTypeinstance.final CParseError.BuildersetException(Exception exception) Initializes the optional valueexceptionto exception.final CParseError.BuildersetException(Optional<? extends Exception> exception) Initializes the optional valueexceptionto exception.final CParseError.BuildersetLexical(com.io7m.jlexing.core.LexicalPosition<URI> lexical) Initializes the value for thelexicalattribute.final CParseError.BuildersetMessage(String message) Initializes the value for themessageattribute.final CParseError.BuildersetSeverity(CParseErrorType.Severity severity) Initializes the value for theseverityattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedCParseErrorTypeinstance. 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:
thisbuilder for use in a chained invocation
-
setLexical
Initializes the value for thelexicalattribute.- Parameters:
lexical- The value for lexical- Returns:
thisbuilder for use in a chained invocation
-
setSeverity
Initializes the value for theseverityattribute.- Parameters:
severity- The value for severity- Returns:
thisbuilder for use in a chained invocation
-
setMessage
Initializes the value for themessageattribute.- Parameters:
message- The value for message- Returns:
thisbuilder for use in a chained invocation
-
setException
Initializes the optional valueexceptionto exception.- Parameters:
exception- The value for exception- Returns:
thisbuilder for chained invocation
-
setException
Initializes the optional valueexceptionto exception.- Parameters:
exception- The value for exception- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newCParseError.- Returns:
- An immutable instance of CParseError
- Throws:
IllegalStateException- if any required attributes are missing
-