Package trial.gaurav.customer
Class Customer
java.lang.Object
trial.gaurav.customer.Customer
The `Customer` class represents a customer with a unique ID, a name, and an age.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanequals(int id) Checks if the customer's ID equals the specified ID.intGets the age of the customer.intGets the ID of the customer.Gets the name of the customer.voidsetCustomerAge(int customerAge) Sets the age of the customer.voidsetCustomerId(int customerId) Sets the ID of the customer.voidsetCustomerName(String customerName) Sets the name of the customer.
-
Field Details
-
customerId
private int customerId -
customerName
-
customerAge
private int customerAge
-
-
Constructor Details
-
Customer
Constructs a new `Customer` object with the given ID, name, and age.- Parameters:
id- The unique ID of the customer.name- The name of the customer.age- The age of the customer.
-
-
Method Details
-
getCustomerId
public int getCustomerId()Gets the ID of the customer.- Returns:
- The customer ID.
-
setCustomerId
public void setCustomerId(int customerId) Sets the ID of the customer.- Parameters:
customerId- The customer ID to be set.
-
getCustomerName
Gets the name of the customer.- Returns:
- The customer's name.
-
setCustomerName
Sets the name of the customer.- Parameters:
customerName- The customer's name to be set.
-
getCustomerAge
public int getCustomerAge()Gets the age of the customer.- Returns:
- The customer's age.
-
setCustomerAge
public void setCustomerAge(int customerAge) Sets the age of the customer.- Parameters:
customerAge- The customer's age to be set.
-
equals
public boolean equals(int id) Checks if the customer's ID equals the specified ID.- Parameters:
id- The ID to compare with the customer's ID.- Returns:
- True if the customer's ID equals the specified ID, otherwise false.
-