@ParametersAreNonnullByDefault @Generated(value="org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableAttachment extends Object implements Attachment
Attachment.
Use the builder to create immutable instances:
ImmutableAttachment.builder().
| Modifier and Type | Class and Description |
|---|---|
static class |
ImmutableAttachment.Builder
Builds instances of type
ImmutableAttachment. |
| Modifier and Type | Method and Description |
|---|---|
static ImmutableAttachment.Builder |
builder()
Creates a builder for
ImmutableAttachment. |
String |
contentType() |
static ImmutableAttachment |
copyOf(Attachment instance)
Creates an immutable copy of a
Attachment value. |
boolean |
equals(Object another)
This instance is equal to all instances of
ImmutableAttachment that have equal attribute values. |
int |
hashCode()
Computes a hash code from attributes:
octetStream, name, contentType, length. |
Long |
length() |
Optional<String> |
name() |
InputStream |
octetStream() |
String |
toString()
Prints the immutable value
Attachment with attribute values. |
ImmutableAttachment |
withContentType(String value)
Copy the current immutable object by setting a value for the
contentType attribute. |
ImmutableAttachment |
withLength(Long value)
Copy the current immutable object by setting a value for the
length attribute. |
ImmutableAttachment |
withName(Optional<String> optional)
Copy the current immutable object by setting an optional value for the
name attribute. |
ImmutableAttachment |
withName(String value)
Copy the current immutable object by setting a present value for the optional
name attribute. |
ImmutableAttachment |
withOctetStream(InputStream value)
Copy the current immutable object by setting a value for the
octetStream attribute. |
public InputStream octetStream()
octetStream in interface AttachmentoctetStream attributepublic Optional<String> name()
name in interface Attachmentname attributepublic String contentType()
contentType in interface AttachmentcontentType attributepublic Long length()
length in interface Attachmentlength attributepublic final ImmutableAttachment withOctetStream(InputStream value)
octetStream attribute.
A shallow reference equality check is used to prevent copying of the same value by returning this.value - A new value for octetStreamthis objectpublic final ImmutableAttachment withName(String value)
name attribute.value - The value for namethis objectpublic final ImmutableAttachment withName(Optional<String> optional)
name attribute.
An equality check is used on inner nullable value to prevent copying of the same value by returning this.optional - A value for namethis objectpublic final ImmutableAttachment withContentType(String value)
contentType attribute.
An equals check used to prevent copying of the same value by returning this.value - A new value for contentTypethis objectpublic final ImmutableAttachment withLength(Long value)
length attribute.
An equals check used to prevent copying of the same value by returning this.value - A new value for lengththis objectpublic boolean equals(@Nullable Object another)
ImmutableAttachment that have equal attribute values.public int hashCode()
octetStream, name, contentType, length.public String toString()
Attachment with attribute values.public static ImmutableAttachment copyOf(Attachment instance)
Attachment 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 ImmutableAttachment.Builder builder()
ImmutableAttachment.
ImmutableAttachment.builder()
.octetStream(java.io.InputStream) // required octetStream
.name(String) // optional name
.contentType(String) // required contentType
.length(Long) // required length
.build();
Copyright © 2023 iland Internet Solutions, Corp. All rights reserved.