Class Context
java.lang.Object
com.hubspot.slack.client.models.blocks.Context
- All Implemented Interfaces:
BlockOrAttachment,Block,ContainerChildBlock,ContextIF,ChatUnfurlBlocksOrAttachment
@Generated(from="ContextIF",
generator="Immutables")
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
public final class Context
extends Object
implements ContextIF
Immutable implementation of
ContextIF.
Use the builder to create immutable instances:
Context.builder().
Use the static factory method to create immutable instances:
Context.of().
-
Nested Class Summary
Nested Classes -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Context.Builderbuilder()Creates a builder forContext.static ContextCreates an immutable copy of aContextIFvalue.booleanThis instance is equal to all instances ofContextthat have equal attribute values.getType()inthashCode()Computes a hash code from attributes:blockId,type,elements.static Contextof(Iterable<? extends ImageBlockOrText> elements) Construct a new immutableContextinstance.static Contextof(List<ImageBlockOrText> elements) Construct a new immutableContextinstance.toString()Prints the immutable valueContextwith attribute values.final ContextwithBlockId(String value) Copy the current immutable object by setting a present value for the optionalblockIdattribute.final ContextwithBlockId(Optional<String> optional) Copy the current immutable object by setting an optional value for theblockIdattribute.final ContextwithElements(ImageBlockOrText... elements) Copy the current immutable object with elements that replace the content ofelements.final ContextwithElements(Iterable<? extends ImageBlockOrText> elements) Copy the current immutable object with elements that replace the content ofelements.
-
Method Details
-
getBlockId
- Specified by:
getBlockIdin interfaceBlock- Returns:
- The value of the
blockIdattribute
-
getType
-
getElements
- Specified by:
getElementsin interfaceContextIF- Returns:
- The value of the
elementsattribute
-
withBlockId
Copy the current immutable object by setting a present value for the optionalblockIdattribute.- Parameters:
value- The value for blockId,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withBlockId
Copy the current immutable object by setting an optional value for theblockIdattribute. An equality check is used on inner value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for blockId- Returns:
- A modified copy or
thisif not changed
-
withElements
Copy the current immutable object with elements that replace the content ofelements.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withElements
Copy the current immutable object with elements that replace the content ofelements. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of elements elements to set- Returns:
- A modified copy or
thisif not changed
-
equals
This instance is equal to all instances ofContextthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:blockId,type,elements. -
toString
Prints the immutable valueContextwith attribute values. -
of
Construct a new immutableContextinstance.- Parameters:
elements- The value for theelementsattribute- Returns:
- An immutable Context instance
-
of
Construct a new immutableContextinstance.- Parameters:
elements- The value for theelementsattribute- Returns:
- An immutable Context instance
-
copyOf
Creates an immutable copy of aContextIFvalue. 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 Context instance
-
builder
Creates a builder forContext.Context.builder() .setBlockId(Optional<String>) // optionalblockId.addElements|addAllElements(com.hubspot.slack.client.models.blocks.objects.ImageBlockOrText) //elementselements .build();- Returns:
- A new Context builder
-