public class AttachmentToAttachmentDataQueryResultConverter extends DirectQueryResultConverter<Attachment,AttachmentData>
Constructor and Description |
---|
AttachmentToAttachmentDataQueryResultConverter(Locale locale)
Create a new converter which will return the converted list sorted by filename.
|
Modifier and Type | Method and Description |
---|---|
boolean |
convert(Attachment source,
AttachmentData target)
Converts the temporary object of the query to a list object
|
PageableList<AttachmentData> |
convert(PageableList<Attachment> queryResult)
Converts the temporary object of the query to a list object
|
AttachmentData |
create()
Creates a new pageable list object to fill
|
void |
sortByName(PageableList<AttachmentData> attachments)
Sort the attachments alphabetically by filename using the locale passed to the constructor.
|
convert
convertCollection
public AttachmentToAttachmentDataQueryResultConverter(Locale locale)
locale
- the locale to use for sortingpublic boolean convert(Attachment source, AttachmentData target)
QueryResultConverter
convert
in class QueryResultConverter<Attachment,AttachmentData>
source
- The temporary object returned by the executed querytarget
- The converted list objectpublic PageableList<AttachmentData> convert(PageableList<Attachment> queryResult)
QueryResultConverter
convert
in class QueryResultConverter<Attachment,AttachmentData>
queryResult
- the temporary object returned by the executed querypublic AttachmentData create()
QueryResultConverter
create
in class QueryResultConverter<Attachment,AttachmentData>
public void sortByName(PageableList<AttachmentData> attachments)
attachments
- the attachments to sortCopyright © 2019 Communote team. All rights reserved.