Package angry3vilbot.bankingapp
Class Transaction
java.lang.Object
angry3vilbot.bankingapp.Transaction
Transaction class representing a financial transaction.
It contains the ID, value, title, type, and destination or sender.
This class is used to create and manage transactions in the system.
If the transaction has a destination, it is considered to be an outgoing transaction. If the transaction has a sender, it is considered to be an incoming transaction.
If the transaction has a destination, it is considered to be an outgoing transaction. If the transaction has a sender, it is considered to be an incoming transaction.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringThe destination of the transaction.private intThe ID of the transaction.private StringThe sender of the transaction.private StringThe title of the transaction.private StringThe type of the transaction.private doubleThe value of the transaction. -
Constructor Summary
ConstructorsConstructorDescriptionTransaction(int id, double value, String title, String type, String destination, String sender) Constructs a Transaction object. -
Method Summary
-
Field Details
-
id
private int idThe ID of the transaction. -
value
private double valueThe value of the transaction. -
title
The title of the transaction. -
type
The type of the transaction. -
destination
The destination of the transaction. Indicates that the transaction is outgoing. -
sender
The sender of the transaction. Indicates that the transaction is incoming.
-
-
Constructor Details
-
Transaction
public Transaction(int id, double value, String title, String type, String destination, String sender) Constructs a Transaction object.- Parameters:
id- id of the transactionvalue- value of the transactiontitle- title of the transactiontype- type of the transactiondestination- destination of the transaction (if the transaction is outgoing)sender- sender of the transaction (if the transaction is incoming)
-
-
Method Details
-
getValue
public double getValue()Returns the ID of the transaction.- Returns:
- the ID of the transaction
-
getTitle
Returns the title of the transaction.- Returns:
- the title of the transaction
-
getType
Returns the type of the transaction.- Returns:
- the type of the transaction
-
getDestination
Returns the destination of the transaction. Indicates that the transaction is outgoing.- Returns:
- the destination of the transaction
-
getSender
Returns the sender of the transaction. Indicates that the transaction is incoming.- Returns:
- the sender of the transaction
-