Package app.entity.suggestion
Class SuggestionList
- All Implemented Interfaces:
IFilterableByAnsweredBy<Suggestion>,IFilterableByCamp<Suggestion>,IFilterableByID<Suggestion>,IFilterableBySender<Suggestion>,IFilterableByStatus<Suggestion,,SuggestionStatus> ISerializable,Iterable<Suggestion>
public class SuggestionList
extends RepositoryList<Suggestion>
implements IFilterableByID<Suggestion>, IFilterableByCamp<Suggestion>, IFilterableByStatus<Suggestion,SuggestionStatus>, IFilterableBySender<Suggestion>, IFilterableByAnsweredBy<Suggestion>
Represents a list of suggestions, providing functionalities for filtering
suggestions based on various criteria.
This class extends RepositoryList and implements several interfaces for
filtering.
-
Field Summary
Fields inherited from class app.entity.RepositoryList
all -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new SuggestionList object.SuggestionList(List<Suggestion> all) Constructs a new SuggestionList object. -
Method Summary
Modifier and TypeMethodDescriptionfilterByAnsweredBy(User staff) Filters the list of suggestions by the provided staff.filterByCamp(Camp camp) Filters the list of suggestions by the provided camp.filterByID(String id) Filters the list of suggestions by the provided ID.filterBySender(User sender) Filters the list of suggestions by the provided sender.filterByStatus(SuggestionStatus status) Filters the list of suggestions by the provided status.Serializes the object into a list of lists of strings.toArray()Converts the SuggestionList to an array of Suggestion objects.Methods inherited from class app.entity.RepositoryList
add, clear, get, iterator, remove, size, update, updateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
SuggestionList
Constructs a new SuggestionList object.- Parameters:
all- The list of suggestions to be stored in this object.
-
SuggestionList
public SuggestionList()Constructs a new SuggestionList object.
-
-
Method Details
-
filterByID
Filters the list of suggestions by the provided ID.- Specified by:
filterByIDin interfaceIFilterableByID<Suggestion>- Parameters:
id- The ID to filter by.- Returns:
- A new SuggestionList containing suggestions with the specified ID.
-
filterByCamp
Filters the list of suggestions by the provided camp.- Specified by:
filterByCampin interfaceIFilterableByCamp<Suggestion>- Parameters:
camp- The camp to filter by.- Returns:
- A new SuggestionList containing suggestions related to the specified camp.
-
filterByStatus
Filters the list of suggestions by the provided status.- Specified by:
filterByStatusin interfaceIFilterableByStatus<Suggestion,SuggestionStatus> - Parameters:
status- The status to filter by.- Returns:
- A new SuggestionList containing suggestions with the specified status.
-
filterBySender
Filters the list of suggestions by the provided sender.- Specified by:
filterBySenderin interfaceIFilterableBySender<Suggestion>- Parameters:
sender- The sender to filter by.- Returns:
- A new SuggestionList containing suggestions sent by the specified user.
-
filterByAnsweredBy
Filters the list of suggestions by the provided staff.- Specified by:
filterByAnsweredByin interfaceIFilterableByAnsweredBy<Suggestion>- Parameters:
staff- The staff to filter by.- Returns:
- A new SuggestionList containing suggestions answered by the specified staff.
-
toArray
Converts the SuggestionList to an array of Suggestion objects.- Overrides:
toArrayin classRepositoryList<Suggestion>- Returns:
- An array of Suggestion objects.
-
serialize
Description copied from interface:ISerializableSerializes the object into a list of lists of strings.- Specified by:
serializein interfaceISerializable- Returns:
- An
ArrayListcontaining lists of strings representing the serialized data.
-