@ParametersAreNonnullByDefault @Generated(value={"Immutables.generator","ContextIF"}) @Immutable public final class Context extends Object implements ContextIF
ContextIF.
Use the builder to create immutable instances:
Context.builder().
Use the static factory method to create immutable instances:
Context.of().
| Modifier and Type | Class and Description |
|---|---|
static class |
Context.Builder
Builds instances of type
Context. |
| Modifier and Type | Method and Description |
|---|---|
static Context.Builder |
builder()
Creates a builder for
Context. |
static Context |
copyOf(ContextIF instance)
Creates an immutable copy of a
ContextIF value. |
boolean |
equals(Object another)
This instance is equal to all instances of
Context that have equal attribute values. |
Optional<String> |
getBlockId() |
List<ImageBlockOrText> |
getElements() |
String |
getType() |
int |
hashCode()
Computes a hash code from attributes:
type, elements, blockId. |
static Context |
of(Iterable<? extends ImageBlockOrText> elements)
Construct a new immutable
Context instance. |
static Context |
of(List<ImageBlockOrText> elements)
Construct a new immutable
Context instance. |
String |
toString()
Prints the immutable value
Context with attribute values. |
Context |
withBlockId(Optional<String> optional)
Copy the current immutable object by setting an optional value for the
blockId attribute. |
Context |
withBlockId(String value)
Copy the current immutable object by setting a present value for the optional
blockId attribute. |
Context |
withElements(ImageBlockOrText... elements)
Copy the current immutable object with elements that replace the content of
elements. |
Context |
withElements(Iterable<? extends ImageBlockOrText> elements)
Copy the current immutable object with elements that replace the content of
elements. |
public String getType()
public List<ImageBlockOrText> getElements()
getElements in interface ContextIFelements attributepublic Optional<String> getBlockId()
getBlockId in interface BlockblockId attributepublic final Context withElements(ImageBlockOrText... elements)
elements.elements - The elements to setthis objectpublic final Context withElements(Iterable<? extends ImageBlockOrText> elements)
elements.
A shallow reference equality check is used to prevent copying of the same value by returning this.elements - An iterable of elements elements to setthis objectpublic final Context withBlockId(@Nullable String value)
blockId attribute.value - The value for blockId, null is accepted as java.util.Optional.empty()this objectpublic final Context withBlockId(Optional<String> optional)
blockId attribute.
An equality check is used on inner nullable value to prevent copying of the same value by returning this.optional - A value for blockIdthis objectpublic boolean equals(@Nullable Object another)
Context that have equal attribute values.public int hashCode()
type, elements, blockId.public String toString()
Context with attribute values.public static Context of(List<ImageBlockOrText> elements)
Context instance.elements - The value for the elements attributepublic static Context of(Iterable<? extends ImageBlockOrText> elements)
Context instance.elements - The value for the elements attributepublic static Context copyOf(ContextIF instance)
ContextIF value.
Uses accessors to get values to initialize the new immutable instance.
If an instance is already immutable, it is returned as is.instance - The instance to copypublic static Context.Builder builder()
Context.Copyright © 2019. All rights reserved.