Package com.storedobject.core
Interface HasStreamData
- All Superinterfaces:
ContentType
- All Known Implementing Classes:
AccountDocument
,BusinessDocument
,Document
,FileData
,MediaFile
,MemoAttachment
,PersonalDocument
,StreamData
,VirtualFileData
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
The
HasStreamData
functional interface represents entities that provide access to an instance
of StreamData
. Implementing this interface allows classes to encapsulate functionality for
retrieving stream data associated with them. This can be used in scenarios where the handling,
processing, or transformation of stream-based data is needed.- Author:
- Syam
-
Method Summary
Modifier and TypeMethodDescriptiondefault String
default String
Determines the file name based on the name provided by the implementing entity and the file extension associated with itsStreamData
.default String
getName()
Retrieves the name associated with the implementing entity.Retrieves an instance ofStreamData
.
-
Method Details
-
getStreamData
StreamData getStreamData()Retrieves an instance ofStreamData
.- Returns:
- a
StreamData
object, representing the stream data associated with the implementing entity.
-
getContentType
- Specified by:
getContentType
in interfaceContentType
-
getName
Retrieves the name associated with the implementing entity.- Returns:
- a
String
representing the name, ornull
if no name is available.
-
getFileName
Determines the file name based on the name provided by the implementing entity and the file extension associated with itsStreamData
. If no name is available, a unique name is generated usingUniqueLong.get()
combined with the file extension.- Returns:
- the generated or determined file name as a
String
. If the name is available and already ends with the correct file extension, it is returned as is; otherwise, the correct extension is appended to the name. If no name is available, a unique file name with the correct extension is returned.
-