Package entity
Class AbstractCustomer
java.lang.Object
entity.AbstractCustomer
- All Implemented Interfaces:
Person
- Direct Known Subclasses:
Customer
Abstract base class for customers in the banking system.
Implements common attributes and validation logic.
- Author:
- TAMIL MUGHILAN
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractCustomer
(int id, String name, String phone, String email) Constructs an AbstractCustomer with the given details. -
Method Summary
Modifier and TypeMethodDescriptionabstract int
Gets the branch ID.getEmail()
Gets the person's email address.int
getId()
Gets the person's unique ID.getName()
Gets the person's name.getPhone()
boolean
Validates customer data.boolean
Validates phone number.void
void
setId
(int id) void
void
setPassword
(String password) void
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface entity.Person
isValidEmail, isValidName
-
Field Details
-
id
protected int id -
name
-
phone
-
email
-
password
-
-
Constructor Details
-
AbstractCustomer
Constructs an AbstractCustomer with the given details.- Parameters:
id
- customer IDname
- customer namephone
- customer phone numberemail
- customer email address
-
-
Method Details
-
getPassword
-
setPassword
-
getBranchId
public abstract int getBranchId()Gets the branch ID.- Returns:
- branch ID
-
isValidPhone
public boolean isValidPhone()Validates phone number.- Returns:
- true if valid, false otherwise
-
isValidCustomer
public boolean isValidCustomer()Validates customer data.- Returns:
- true if all fields are valid
-
getId
public int getId()Description copied from interface:Person
Gets the person's unique ID. -
getName
Description copied from interface:Person
Gets the person's name. -
getEmail
Description copied from interface:Person
Gets the person's email address. -
getPhone
-
setId
public void setId(int id) -
setName
-
setEmail
-
setPhone
-