Package app.entity.user
Class UserList
- All Implemented Interfaces:
IFilterableByID<User>,IFilterableBySchool<User>,ISerializable,Iterable<User>
public class UserList
extends RepositoryList<User>
implements IFilterableByID<User>, IFilterableBySchool<User>
The
UserList class represents a list of user objects.
It extends the RepositoryList class and implements the IFilterableByID and ISerializeable interfaces.-
Field Summary
Fields inherited from class app.entity.RepositoryList
all -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfilterByID(String id) Filters the user list by the specified user ID.filterBySchool(String school) Filters the items by school.booleanisEmpty()Checks if the user list is empty.Serializes the user list and represents its data as an ArrayList of ArrayList of Strings.User[]toArray()Converts the user list to an array of users.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
-
UserList
Constructs a UserList object with the specified list of users.- Parameters:
all- The list of users to be included in the user list.
-
UserList
public UserList()Constructs an empty UserList object.
-
-
Method Details
-
filterByID
Filters the user list by the specified user ID.- Specified by:
filterByIDin interfaceIFilterableByID<User>- Parameters:
id- The user ID to filter by.- Returns:
- A UserList containing users with the specified ID.
-
filterBySchool
Description copied from interface:IFilterableBySchoolFilters the items by school.- Specified by:
filterBySchoolin interfaceIFilterableBySchool<User>- Parameters:
school- The school to filter by.- Returns:
- A list of items that were registered on the given school.
-
toArray
Converts the user list to an array of users.- Overrides:
toArrayin classRepositoryList<User>- Returns:
- An array of users.
-
isEmpty
public boolean isEmpty()Checks if the user list is empty.- Returns:
trueif the user list is empty,falseotherwise.
-
serialize
Serializes the user list and represents its data as an ArrayList of ArrayList of Strings.- Specified by:
serializein interfaceISerializable- Returns:
- An
ArrayList<ArrayList<String>>representing the serialized data of the user list.
-