Package app.entity.enquiry
Class EnquiryList
- All Implemented Interfaces:
IFilterableByAnsweredBy<Enquiry>,IFilterableByCamp<Enquiry>,IFilterableByID<Enquiry>,IFilterableBySender<Enquiry>,IFilterableByStatus<Enquiry,,Boolean> ISerializable,Iterable<Enquiry>
public class EnquiryList
extends RepositoryList<Enquiry>
implements IFilterableByID<Enquiry>, IFilterableByCamp<Enquiry>, IFilterableByStatus<Enquiry,Boolean>, IFilterableBySender<Enquiry>, IFilterableByAnsweredBy<Enquiry>
Represents a list of enquiries, providing functionalities for filtering
enquiries 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 an empty EnquiryList.EnquiryList(List<Enquiry> all) Constructs a new EnquiryList with the specified list of enquiries. -
Method Summary
Modifier and TypeMethodDescriptionfilterByAnsweredBy(User answeredBy) Filters the list of enquiries by a specific user who answered the enquiry.filterByCamp(Camp camp) Filters the list of enquiries by a specific camp.filterByID(String id) Filters the list of enquiries by a specific ID.filterBySender(User sender) Filters the list of enquiries by a specific sender.filterByStatus(Boolean status) Filters the list of enquiries by a specific status.Serializes the object into a list of lists of strings.Enquiry[]toArray()Converts the EnquiryList to an array of Enquiry 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
-
EnquiryList
Constructs a new EnquiryList with the specified list of enquiries.- Parameters:
all- A list of Enquiry objects to be managed.
-
EnquiryList
public EnquiryList()Constructs an empty EnquiryList.
-
-
Method Details
-
filterByID
Filters the list of enquiries by a specific ID.- Specified by:
filterByIDin interfaceIFilterableByID<Enquiry>- Parameters:
id- The ID to filter by.- Returns:
- A new EnquiryList containing enquiries that match the given ID.
-
filterByCamp
Filters the list of enquiries by a specific camp.- Specified by:
filterByCampin interfaceIFilterableByCamp<Enquiry>- Parameters:
camp- The camp to filter by.- Returns:
- A new EnquiryList containing enquiries that match the given camp.
-
filterByStatus
Filters the list of enquiries by a specific status.- Specified by:
filterByStatusin interfaceIFilterableByStatus<Enquiry,Boolean> - Parameters:
status- The status to filter by.- Returns:
- A new EnquiryList containing enquiries that match the given status.
-
filterBySender
Filters the list of enquiries by a specific sender.- Specified by:
filterBySenderin interfaceIFilterableBySender<Enquiry>- Parameters:
sender- The sender to filter by.- Returns:
- A new EnquiryList containing enquiries that match the given sender.
-
filterByAnsweredBy
Filters the list of enquiries by a specific user who answered the enquiry.- Specified by:
filterByAnsweredByin interfaceIFilterableByAnsweredBy<Enquiry>- Parameters:
answeredBy- The user who answered the enquiry to filter by.- Returns:
- A new EnquiryList containing enquiries that match the given user who answered the enquiry.
-
toArray
Converts the EnquiryList to an array of Enquiry objects.- Overrides:
toArrayin classRepositoryList<Enquiry>- Returns:
- An array of Enquiry 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.
-