Package com.onec.ui.media
Record Class StoredMedia
java.lang.Object
java.lang.Record
com.onec.ui.media.StoredMedia
- Record Components:
key- the storage-internal identifier (opaque to clients; e.g. a date-sharded path for the filesystem backend, or an object key for S3)url- the address the UI/clients use to fetch the binary back — a framework route (e.g./api/media/2026/06/<uuid>.jpg) for the filesystem backend, or an absolute object-store URL for backends that serve directlycontentType- the stored content type (as accepted; nevernull)size- the stored size in bytesfilename- the original client filename, sanitized; may benullif none was sent
public record StoredMedia(String key, String url, String contentType, long size, String filename)
extends Record
A reference to a stored binary, returned from
MediaStorage.store(java.io.InputStream, java.lang.String, java.lang.String, long) and serialized as the
JSON body of POST /api/media. The url is what callers persist into a file/
image attribute (or a newline-joined gallery value) — never the bytes themselves.-
Constructor Summary
ConstructorsConstructorDescriptionStoredMedia(String key, String url, String contentType, long size, String filename) Creates an instance of aStoredMediarecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecontentTyperecord component.final booleanIndicates whether some other object is "equal to" this one.filename()Returns the value of thefilenamerecord component.final inthashCode()Returns a hash code value for this object.key()Returns the value of thekeyrecord component.longsize()Returns the value of thesizerecord component.final StringtoString()Returns a string representation of this record class.url()Returns the value of theurlrecord component.
-
Constructor Details
-
StoredMedia
Creates an instance of aStoredMediarecord class.- Parameters:
key- the value for thekeyrecord componenturl- the value for theurlrecord componentcontentType- the value for thecontentTyperecord componentsize- the value for thesizerecord componentfilename- the value for thefilenamerecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
key
Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
url
Returns the value of theurlrecord component.- Returns:
- the value of the
urlrecord component
-
contentType
Returns the value of thecontentTyperecord component.- Returns:
- the value of the
contentTyperecord component
-
size
public long size()Returns the value of thesizerecord component.- Returns:
- the value of the
sizerecord component
-
filename
Returns the value of thefilenamerecord component.- Returns:
- the value of the
filenamerecord component
-