Class EnquiryList

java.lang.Object
app.entity.RepositoryList<Enquiry>
app.entity.enquiry.EnquiryList
All Implemented Interfaces:
IFilterableByAnsweredBy<Enquiry>, IFilterableByCamp<Enquiry>, IFilterableByID<Enquiry>, IFilterableBySender<Enquiry>, IFilterableByStatus<Enquiry,Boolean>, ISerializable, Iterable<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.
  • Constructor Details

    • EnquiryList

      public EnquiryList(List<Enquiry> all)
      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

      public EnquiryList filterByID(String id)
      Filters the list of enquiries by a specific ID.
      Specified by:
      filterByID in interface IFilterableByID<Enquiry>
      Parameters:
      id - The ID to filter by.
      Returns:
      A new EnquiryList containing enquiries that match the given ID.
    • filterByCamp

      public EnquiryList filterByCamp(Camp camp)
      Filters the list of enquiries by a specific camp.
      Specified by:
      filterByCamp in interface IFilterableByCamp<Enquiry>
      Parameters:
      camp - The camp to filter by.
      Returns:
      A new EnquiryList containing enquiries that match the given camp.
    • filterByStatus

      public EnquiryList filterByStatus(Boolean status)
      Filters the list of enquiries by a specific status.
      Specified by:
      filterByStatus in interface IFilterableByStatus<Enquiry,Boolean>
      Parameters:
      status - The status to filter by.
      Returns:
      A new EnquiryList containing enquiries that match the given status.
    • filterBySender

      public EnquiryList filterBySender(User sender)
      Filters the list of enquiries by a specific sender.
      Specified by:
      filterBySender in interface IFilterableBySender<Enquiry>
      Parameters:
      sender - The sender to filter by.
      Returns:
      A new EnquiryList containing enquiries that match the given sender.
    • filterByAnsweredBy

      public EnquiryList filterByAnsweredBy(User answeredBy)
      Filters the list of enquiries by a specific user who answered the enquiry.
      Specified by:
      filterByAnsweredBy in interface IFilterableByAnsweredBy<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

      public Enquiry[] toArray()
      Converts the EnquiryList to an array of Enquiry objects.
      Overrides:
      toArray in class RepositoryList<Enquiry>
      Returns:
      An array of Enquiry objects.
    • serialize

      public ArrayList<ArrayList<String>> serialize()
      Description copied from interface: ISerializable
      Serializes the object into a list of lists of strings.
      Specified by:
      serialize in interface ISerializable
      Returns:
      An ArrayList containing lists of strings representing the serialized data.