Package io.dialob.api.rest
Class ImmutableErrors.Error.Builder
- java.lang.Object
-
- io.dialob.api.rest.ImmutableErrors.Error.Builder
-
- Enclosing class:
- ImmutableErrors.Error
@NotThreadSafe public static final class ImmutableErrors.Error.Builder extends Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableErrors.Errorbuild()Builds a newError.ImmutableErrors.Error.Buildercode(String code)Initializes the value for thecodeattribute.ImmutableErrors.Error.Buildercontext(String context)Initializes the value for thecontextattribute.ImmutableErrors.Error.Buildererror(String error)Initializes the value for theerrorattribute.ImmutableErrors.Error.Builderfrom(Errors.Error instance)Fill a builder with attribute values from the providedErrorinstance.ImmutableErrors.Error.BuilderrejectedValue(Object rejectedValue)Initializes the value for therejectedValueattribute.
-
-
-
Method Detail
-
from
public final ImmutableErrors.Error.Builder from(Errors.Error instance)
Fill a builder with attribute values from the providedErrorinstance. 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
-
code
public final ImmutableErrors.Error.Builder code(String code)
Initializes the value for thecodeattribute.- Parameters:
code- The value for code (can benull)- Returns:
thisbuilder for use in a chained invocation
-
context
public final ImmutableErrors.Error.Builder context(String context)
Initializes the value for thecontextattribute.- Parameters:
context- The value for context (can benull)- Returns:
thisbuilder for use in a chained invocation
-
rejectedValue
public final ImmutableErrors.Error.Builder rejectedValue(Object rejectedValue)
Initializes the value for therejectedValueattribute.- Parameters:
rejectedValue- The value for rejectedValue (can benull)- Returns:
thisbuilder for use in a chained invocation
-
error
public final ImmutableErrors.Error.Builder error(String error)
Initializes the value for theerrorattribute.- Parameters:
error- The value for error (can benull)- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableErrors.Error build()
Builds a newError.- Returns:
- An immutable instance of Error
- Throws:
IllegalStateException- if any required attributes are missing
-
-