Validators
Class QuantityValidator
java.lang.Object
Validators.QuantityValidator
- public class QuantityValidator
- extends java.lang.Object
- Author:
- student
This class is being used for validating the quantity of stock owned
when the user wants to sell his/her stocks.
|
Field Summary |
private java.lang.String |
message
|
|
Constructor Summary |
QuantityValidator()
This is the constructor for QuantityValidator.java |
|
Method Summary |
java.lang.String |
getMessage()
This method is being used for getting the message if the validation
was unsuccessful. |
void |
setMessage(java.lang.String message)
This method is being used for settint the error message. |
boolean |
validate(User_Data user,
Stock_Data stock)
This method is being used for validating the quantity of the stocks owned
for the given user. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
message
private java.lang.String message
QuantityValidator
public QuantityValidator()
- This is the constructor for QuantityValidator.java
getMessage
public java.lang.String getMessage()
- This method is being used for getting the message if the validation
was unsuccessful.
- Returns:
- String The message to be displayed.
setMessage
public void setMessage(java.lang.String message)
- This method is being used for settint the error message.
- Parameters:
message - The message to be displayed.
- Returns:
- void
validate
public boolean validate(User_Data user,
Stock_Data stock)
- This method is being used for validating the quantity of the stocks owned
for the given user.
- Parameters:
user - The user whose ownership stocks quantity has to be checked.stock - The stock which is to be sold.
- Returns:
- boolean Specifies whether the validation was successful.