public static final class ImmutableError.Builder extends Object
ImmutableError.
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.
| Modifier and Type | Method and Description |
|---|---|
ImmutableError.Builder |
addAllParameters(Iterable<String> elements)
Adds elements to
parameters list. |
ImmutableError.Builder |
addParameters(String... elements)
Adds elements to
parameters list. |
ImmutableError.Builder |
addParameters(String element)
Adds one element to
parameters list. |
ImmutableError.Builder |
attributes(Map<String,? extends Object> attributes)
Sets or replaces all mappings from the specified map as entries for the
attributes map. |
ImmutableError |
build()
Builds a new
ImmutableError. |
ImmutableError.Builder |
code(String code)
Initializes the value for the
code attribute. |
ImmutableError.Builder |
description(Optional<String> description)
Initializes the optional value
description to description. |
ImmutableError.Builder |
description(String description)
Initializes the optional value
description to description. |
ImmutableError.Builder |
from(Verifier.Error instance)
Fill a builder with attribute values from the provided
Error instance. |
ImmutableError.Builder |
parameters(Iterable<String> elements)
Sets or replaces all elements for
parameters list. |
ImmutableError.Builder |
putAllAttributes(Map<String,? extends Object> attributes)
Put all mappings from the specified map as entries to
attributes map. |
ImmutableError.Builder |
putAttributes(Map.Entry<String,? extends Object> entry)
Put one entry to the
attributes map. |
ImmutableError.Builder |
putAttributes(String key,
Object value)
Put one entry to the
attributes map. |
public final ImmutableError.Builder from(Verifier.Error instance)
Error instance.
Regular attribute values will be replaced with those from the given instance.
Absent optional values will not replace present values.
Collection elements and entries will be added, not replaced.instance - The instance from which to copy valuesthis builder for use in a chained invocationpublic final ImmutableError.Builder code(String code)
code attribute.code - The value for codethis builder for use in a chained invocationpublic final ImmutableError.Builder description(String description)
description to description.description - The value for descriptionthis builder for chained invocationpublic final ImmutableError.Builder description(Optional<String> description)
description to description.description - The value for descriptionthis builder for use in a chained invocationpublic final ImmutableError.Builder addParameters(String element)
parameters list.element - A parameters elementthis builder for use in a chained invocationpublic final ImmutableError.Builder addParameters(String... elements)
parameters list.elements - An array of parameters elementsthis builder for use in a chained invocationpublic final ImmutableError.Builder parameters(Iterable<String> elements)
parameters list.elements - An iterable of parameters elementsthis builder for use in a chained invocationpublic final ImmutableError.Builder addAllParameters(Iterable<String> elements)
parameters list.elements - An iterable of parameters elementsthis builder for use in a chained invocationpublic final ImmutableError.Builder putAttributes(String key, Object value)
attributes map.key - The key in the attributes mapvalue - The associated value in the attributes mapthis builder for use in a chained invocationpublic final ImmutableError.Builder putAttributes(Map.Entry<String,? extends Object> entry)
attributes map. Nulls are not permittedentry - The key and value entrythis builder for use in a chained invocationpublic final ImmutableError.Builder attributes(Map<String,? extends Object> attributes)
attributes map. Nulls are not permittedattributes - The entries that will be added to the attributes mapthis builder for use in a chained invocationpublic final ImmutableError.Builder putAllAttributes(Map<String,? extends Object> attributes)
attributes map. Nulls are not permittedattributes - The entries that will be added to the attributes mapthis builder for use in a chained invocationpublic ImmutableError build()
ImmutableError.IllegalStateException - if any required attributes are missingCopyright © 2016–2017 Red Hat. All rights reserved.