Package io.dialob.api.questionnaire
Class ImmutableError
- java.lang.Object
-
- io.dialob.api.questionnaire.ImmutableError
-
- All Implemented Interfaces:
Error,Serializable
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class ImmutableError extends Object implements Error
Immutable implementation ofError.Use the builder to create immutable instances:
ImmutableError.builder(). Use the static factory method to create immutable instances:ImmutableError.of().- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableError.BuilderBuilds instances of typeImmutableError.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableError.Builderbuilder()Creates a builder forImmutableError.static ImmutableErrorcopyOf(Error instance)Creates an immutable copy of aErrorvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableErrorthat have equal attribute values.StringgetCode()StringgetDescription()StringgetId()inthashCode()Computes a hash code from attributes:id,code,description.static ImmutableErrorof(String id, String code, String description)Construct a new immutableErrorinstance.StringtoString()Prints the immutable valueErrorwith attribute values.ImmutableErrorwithCode(String value)Copy the current immutable object by setting a value for thecodeattribute.ImmutableErrorwithDescription(String value)Copy the current immutable object by setting a value for thedescriptionattribute.ImmutableErrorwithId(String value)Copy the current immutable object by setting a value for theidattribute.
-
-
-
Method Detail
-
getId
public String getId()
-
getCode
public String getCode()
-
getDescription
public String getDescription()
- Specified by:
getDescriptionin interfaceError- Returns:
- The value of the
descriptionattribute
-
withId
public final ImmutableError withId(String value)
Copy the current immutable object by setting a value for theidattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for id- Returns:
- A modified copy of the
thisobject
-
withCode
public final ImmutableError withCode(String value)
Copy the current immutable object by setting a value for thecodeattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for code (can benull)- Returns:
- A modified copy of the
thisobject
-
withDescription
public final ImmutableError withDescription(String value)
Copy the current immutable object by setting a value for thedescriptionattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for description (can benull)- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableErrorthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:id,code,description.
-
toString
public String toString()
Prints the immutable valueErrorwith attribute values.
-
of
public static ImmutableError of(String id, String code, String description)
Construct a new immutableErrorinstance.- Parameters:
id- The value for theidattributecode- The value for thecodeattributedescription- The value for thedescriptionattribute- Returns:
- An immutable Error instance
-
copyOf
public static ImmutableError copyOf(Error instance)
Creates an immutable copy of aErrorvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable Error instance
-
builder
public static ImmutableError.Builder builder()
Creates a builder forImmutableError.ImmutableError.builder() .id(String) // requiredid.code(String | null) // nullablecode.description(String | null) // nullabledescription.build();- Returns:
- A new ImmutableError builder
-
-