Package entity

Class AbstractCustomer

java.lang.Object
entity.AbstractCustomer
All Implemented Interfaces:
Person
Direct Known Subclasses:
Customer

public abstract class AbstractCustomer extends Object implements Person
Abstract base class for customers in the banking system. Implements common attributes and validation logic.
Author:
TAMIL MUGHILAN
  • Field Details

    • id

      protected int id
    • name

      protected String name
    • phone

      protected String phone
    • email

      protected String email
    • password

      protected String password
  • Constructor Details

    • AbstractCustomer

      public AbstractCustomer(int id, String name, String phone, String email)
      Constructs an AbstractCustomer with the given details.
      Parameters:
      id - customer ID
      name - customer name
      phone - customer phone number
      email - customer email address
  • Method Details

    • getPassword

      public String getPassword()
    • setPassword

      public void setPassword(String password)
    • 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.
      Specified by:
      getId in interface Person
      Returns:
      the person's ID
    • getName

      public String getName()
      Description copied from interface: Person
      Gets the person's name.
      Specified by:
      getName in interface Person
      Returns:
      the person's name
    • getEmail

      public String getEmail()
      Description copied from interface: Person
      Gets the person's email address.
      Specified by:
      getEmail in interface Person
      Returns:
      the email address
    • getPhone

      public String getPhone()
    • setId

      public void setId(int id)
    • setName

      public void setName(String name)
    • setEmail

      public void setEmail(String email)
    • setPhone

      public void setPhone(String phone)