Package bank
Class Client
java.lang.Object
bank.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:
- Serialized Form
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic Comparator<Client>NAME_COMPARATOR allow comparing holders based on their names.static Comparator<Client>NUMBER_COMPARATOR allow comparing holders based on their ids. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
NUMBER_COMPARATOR
NUMBER_COMPARATOR allow comparing holders based on their ids.- See Also:
Comparator
-
NAME_COMPARATOR
NAME_COMPARATOR allow comparing holders based on their names.- See Also:
Comparator
-
-
Constructor Details
-
Client
Constructor (initializes id and name).- Parameters:
id- the holder's id.name- the holder's name.- Throws:
DuplicateClientException
-
Client
Constructor (initializes from array of String).- Parameters:
init- the holder's parameters.- Throws:
DuplicateClientException
-
-
Method Details
-
getId
public final int getId()- Returns:
- the holder's id.
-
getName
- Returns:
- the holder's name.
-
setName
- Parameters:
name- the new name.
-
equals
- Overrides:
equalsin classObject- See Also:
Object.equals(java.lang.Object)
-
toString
- Overrides:
toStringin classObject- See Also:
Object.toString()
-