Class Client
java.lang.Object
bank.client.Client
- All Implemented Interfaces:
Serializable
Class Holder contains information about holders of bank accounts. Each holder
is identified by a number. Note that this class is not comparable.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Comparator<Client> NAME_COMPARATOR allow comparing holders based on their names.static final Comparator<Client> NUMBER_COMPARATOR allow comparing holders based on their numbers. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
NUMBER_COMPARATOR
NUMBER_COMPARATOR allow comparing holders based on their numbers. This version uses a lambda function instead of an explicit class, but the functionality is the same.- See Also:
-
NAME_COMPARATOR
NAME_COMPARATOR allow comparing holders based on their names. This version uses a lambda function instead of an explicit class, but the functionality is the same.- See Also:
-
-
Constructor Details
-
Client
Constructor (initializes id and name).- Parameters:
number- the holder's id.name- the holder's name.- Throws:
DuplicateClientException
-
Client
Constructor (initializes from array of String).- Parameters:
fields- the holder's parameters.- Throws:
DuplicateClientException
-
-
Method Details
-
getNumber
public final int getNumber()- Returns:
- the holder's id.
-
getName
- Returns:
- the holder's name.
-
setName
- Parameters:
name- the new name.
-
equals
-
toString
-