Class File
java.lang.Object
com.hubspot.slack.client.models.blocks.File
- All Implemented Interfaces:
BlockOrAttachment,Block,ContainerChildBlock,FileIF,ChatUnfurlBlocksOrAttachment
@Generated(from="FileIF",
generator="Immutables")
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
public final class File
extends Object
implements FileIF
Immutable implementation of
FileIF.
Use the builder to create immutable instances:
File.builder().
Use the static factory method to create immutable instances:
File.of().
-
Nested Class Summary
Nested Classes -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic File.Builderbuilder()Creates a builder forFile.static FileCreates an immutable copy of aFileIFvalue.booleanThis instance is equal to all instances ofFilethat have equal attribute values.getType()inthashCode()Computes a hash code from attributes:blockId,type,externalId,source.static FileConstruct a new immutableFileinstance.toString()Prints the immutable valueFilewith attribute values.final FilewithBlockId(String value) Copy the current immutable object by setting a present value for the optionalblockIdattribute.final FilewithBlockId(Optional<String> optional) Copy the current immutable object by setting an optional value for theblockIdattribute.final FilewithExternalId(String value) Copy the current immutable object by setting a value for theexternalIdattribute.final FilewithSource(String value) Copy the current immutable object by setting a value for thesourceattribute.
-
Method Details
-
getBlockId
- Specified by:
getBlockIdin interfaceBlock- Returns:
- The value of the
blockIdattribute
-
getType
-
getExternalId
- Specified by:
getExternalIdin interfaceFileIF- Returns:
- The value of the
externalIdattribute
-
getSource
-
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
-
withExternalId
Copy the current immutable object by setting a value for theexternalIdattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for externalId- Returns:
- A modified copy or the
thisobject
-
withSource
Copy the current immutable object by setting a value for thesourceattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for source- Returns:
- A modified copy or the
thisobject
-
equals
This instance is equal to all instances ofFilethat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:blockId,type,externalId,source. -
toString
Prints the immutable valueFilewith attribute values. -
of
Construct a new immutableFileinstance.- Parameters:
externalId- The value for theexternalIdattributesource- The value for thesourceattribute- Returns:
- An immutable File instance
-
copyOf
Creates an immutable copy of aFileIFvalue. 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 File instance
-
builder
Creates a builder forFile.File.builder() .setBlockId(Optional<String>) // optionalblockId.setExternalId(String) // requiredexternalId.setSource(String) // requiredsource.build();- Returns:
- A new File builder
-