Class Image
java.lang.Object
com.hubspot.slack.client.models.blocks.elements.Image
- All Implemented Interfaces:
BlockElement,ImageIF
@Generated(from="ImageIF",
generator="Immutables")
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
public final class Image
extends Object
implements ImageIF
Immutable implementation of
ImageIF.
Use the builder to create immutable instances:
Image.builder().
Use the static factory method to create immutable instances:
Image.of().
-
Nested Class Summary
Nested Classes -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Image.Builderbuilder()Creates a builder forImage.static ImageCreates an immutable copy of aImageIFvalue.booleanThis instance is equal to all instances ofImagethat have equal attribute values.getType()inthashCode()Computes a hash code from attributes:type,imageUrl,altText,slackFile.static ImageConstruct a new immutableImageinstance.static ImageConstruct a new immutableImageinstance.toString()Prints the immutable valueImagewith attribute values.final ImagewithAltText(String value) Copy the current immutable object by setting a value for thealtTextattribute.final ImagewithImageUrl(String value) Copy the current immutable object by setting a present value for the optionalimageUrlattribute.final ImagewithImageUrl(Optional<String> optional) Copy the current immutable object by setting an optional value for theimageUrlattribute.final ImagewithSlackFile(SlackFileObject value) Copy the current immutable object by setting a present value for the optionalslackFileattribute.final ImagewithSlackFile(Optional<? extends SlackFileObject> optional) Copy the current immutable object by setting an optional value for theslackFileattribute.
-
Method Details
-
getType
- Specified by:
getTypein interfaceBlockElement- Specified by:
getTypein interfaceImageIF- Returns:
- The computed-at-construction value of the
typeattribute
-
getImageUrl
- Specified by:
getImageUrlin interfaceImageIF- Returns:
- The value of the
imageUrlattribute
-
getAltText
- Specified by:
getAltTextin interfaceImageIF- Returns:
- The value of the
altTextattribute
-
getSlackFile
- Specified by:
getSlackFilein interfaceImageIF- Returns:
- The value of the
slackFileattribute
-
withImageUrl
Copy the current immutable object by setting a present value for the optionalimageUrlattribute.- Parameters:
value- The value for imageUrl,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withImageUrl
Copy the current immutable object by setting an optional value for theimageUrlattribute. An equality check is used on inner value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for imageUrl- Returns:
- A modified copy or
thisif not changed
-
withAltText
Copy the current immutable object by setting a value for thealtTextattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for altText- Returns:
- A modified copy or the
thisobject
-
withSlackFile
Copy the current immutable object by setting a present value for the optionalslackFileattribute.- Parameters:
value- The value for slackFile,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withSlackFile
Copy the current immutable object by setting an optional value for theslackFileattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for slackFile- Returns:
- A modified copy or
thisif not changed
-
equals
This instance is equal to all instances ofImagethat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:type,imageUrl,altText,slackFile. -
toString
Prints the immutable valueImagewith attribute values. -
of
Construct a new immutableImageinstance.- Parameters:
imageUrl- The value for theimageUrlattributealtText- The value for thealtTextattribute- Returns:
- An immutable Image instance
-
of
Construct a new immutableImageinstance.- Parameters:
imageUrl- The value for theimageUrlattributealtText- The value for thealtTextattribute- Returns:
- An immutable Image instance
-
copyOf
Creates an immutable copy of aImageIFvalue. 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 Image instance
-
builder
Creates a builder forImage.Image.builder() .setImageUrl(Optional<String>) // optionalimageUrl.setAltText(String) // requiredaltText.setSlackFile(Optional<com.hubspot.slack.client.models.blocks.SlackFileObject>) // optionalslackFile.build();- Returns:
- A new Image builder
-