Record Class ObjectMetadataWrite
java.lang.Object
java.lang.Record
io.micronaut.objectstorage.metadata.ObjectMetadataWrite
- Record Components:
key- The object key.metadata- User metadata.attributes- Portable custom attributes.contentType- The optional content type.contentLength- The optional content length.etag- The optional entity tag.lastModified- The optional last modified instant.
public record ObjectMetadataWrite(@NonNull String key, @NonNull Map<String,String> metadata, @NonNull Map<String,String> attributes, @Nullable String contentType, @Nullable Long contentLength, @Nullable String etag, @Nullable Instant lastModified)
extends Record
Portable object metadata write model.
This write model represents a full metadata snapshot. Implementations should treat save operations as replace/upsert, not patch/merge.
- Since:
- 3.0.0
- Author:
- Álvaro Sánchez-Mariscal
-
Constructor Summary
ConstructorsConstructorDescriptionObjectMetadataWrite(@NonNull String key, @NonNull Map<String, String> metadata) Creates a metadata write with metadata only.ObjectMetadataWrite(@NonNull String key, @NonNull Map<String, String> metadata, @NonNull Map<String, String> attributes, @Nullable String contentType, @Nullable Long contentLength, @Nullable String etag, @Nullable Instant lastModified) Creates an instance of aObjectMetadataWriterecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theattributesrecord component.@Nullable LongReturns the value of thecontentLengthrecord component.@Nullable StringReturns the value of thecontentTyperecord component.final booleanIndicates whether some other object is "equal to" this one.@Nullable Stringetag()Returns the value of theetagrecord component.final inthashCode()Returns a hash code value for this object.@NonNull Stringkey()Returns the value of thekeyrecord component.@Nullable InstantReturns the value of thelastModifiedrecord component.metadata()Returns the value of themetadatarecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ObjectMetadataWrite
public ObjectMetadataWrite(@NonNull String key, @NonNull Map<String, String> metadata, @NonNull Map<String, String> attributes, @Nullable String contentType, @Nullable Long contentLength, @Nullable String etag, @Nullable Instant lastModified) Creates an instance of aObjectMetadataWriterecord class.- Parameters:
key- the value for thekeyrecord componentmetadata- the value for themetadatarecord componentattributes- the value for theattributesrecord componentcontentType- the value for thecontentTyperecord componentcontentLength- the value for thecontentLengthrecord componentetag- the value for theetagrecord componentlastModified- the value for thelastModifiedrecord component
-
ObjectMetadataWrite
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
key
-
metadata
-
attributes
Returns the value of theattributesrecord component.- Returns:
- the value of the
attributesrecord component
-
contentType
Returns the value of thecontentTyperecord component.- Returns:
- the value of the
contentTyperecord component
-
contentLength
Returns the value of thecontentLengthrecord component.- Returns:
- the value of the
contentLengthrecord component
-
etag
-
lastModified
Returns the value of thelastModifiedrecord component.- Returns:
- the value of the
lastModifiedrecord component
-