Package org.projectnessie.error
Class ImmutableNessieError.Builder
- java.lang.Object
-
- org.projectnessie.error.ImmutableNessieError.Builder
-
- Enclosing class:
- ImmutableNessieError
@NotThreadSafe public static final class ImmutableNessieError.Builder extends Object
Builds instances of typeImmutableNessieError. 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 ImmutableNessieErrorbuild()Builds a newImmutableNessieError.ImmutableNessieError.BuilderclientProcessingException(Exception clientProcessingException)Initializes the value for theclientProcessingExceptionattribute.ImmutableNessieError.BuildererrorCode(ErrorCode errorCode)Initializes the value for theerrorCodeattribute.ImmutableNessieError.Builderfrom(NessieError instance)Fill a builder with attribute values from the providedNessieErrorinstance.ImmutableNessieError.Buildermessage(String message)Initializes the value for themessageattribute.ImmutableNessieError.Builderreason(String reason)Initializes the value for thereasonattribute.ImmutableNessieError.BuilderserverStackTrace(String serverStackTrace)Initializes the value for theserverStackTraceattribute.ImmutableNessieError.Builderstatus(int status)Initializes the value for thestatusattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableNessieError.Builder from(NessieError instance)
Fill a builder with attribute values from the providedNessieErrorinstance. 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
-
status
@CanIgnoreReturnValue public final ImmutableNessieError.Builder status(int status)
Initializes the value for thestatusattribute.- Parameters:
status- The value for status- Returns:
thisbuilder for use in a chained invocation
-
reason
@CanIgnoreReturnValue public final ImmutableNessieError.Builder reason(String reason)
Initializes the value for thereasonattribute.- Parameters:
reason- The value for reason- Returns:
thisbuilder for use in a chained invocation
-
message
@CanIgnoreReturnValue public final ImmutableNessieError.Builder message(String message)
Initializes the value for themessageattribute.If not set, this attribute will have a default value as returned by the initializer of
message.- Parameters:
message- The value for message- Returns:
thisbuilder for use in a chained invocation
-
errorCode
@CanIgnoreReturnValue public final ImmutableNessieError.Builder errorCode(ErrorCode errorCode)
Initializes the value for theerrorCodeattribute.If not set, this attribute will have a default value as returned by the initializer of
errorCode.- Parameters:
errorCode- The value for errorCode- Returns:
thisbuilder for use in a chained invocation
-
serverStackTrace
@CanIgnoreReturnValue public final ImmutableNessieError.Builder serverStackTrace(@Nullable String serverStackTrace)
Initializes the value for theserverStackTraceattribute.- Parameters:
serverStackTrace- The value for serverStackTrace (can benull)- Returns:
thisbuilder for use in a chained invocation
-
clientProcessingException
@CanIgnoreReturnValue public final ImmutableNessieError.Builder clientProcessingException(@Nullable Exception clientProcessingException)
Initializes the value for theclientProcessingExceptionattribute.- Parameters:
clientProcessingException- The value for clientProcessingException (can benull)- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableNessieError build()
Builds a newImmutableNessieError.- Returns:
- An immutable instance of NessieError
- Throws:
IllegalStateException- if any required attributes are missing
-
-