Class Transaction

java.lang.Object
angry3vilbot.bankingapp.Transaction

public class Transaction extends Object
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.
  • Field Details

    • id

      private int id
      The ID of the transaction.
    • value

      private double value
      The value of the transaction.
    • title

      private String title
      The title of the transaction.
    • type

      private String type
      The type of the transaction.
    • destination

      private String destination
      The destination of the transaction. Indicates that the transaction is outgoing.
    • sender

      private String 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 transaction
      value - value of the transaction
      title - title of the transaction
      type - type of the transaction
      destination - 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

      public String getTitle()
      Returns the title of the transaction.
      Returns:
      the title of the transaction
    • getType

      public String getType()
      Returns the type of the transaction.
      Returns:
      the type of the transaction
    • getDestination

      public String getDestination()
      Returns the destination of the transaction. Indicates that the transaction is outgoing.
      Returns:
      the destination of the transaction
    • getSender

      public String getSender()
      Returns the sender of the transaction. Indicates that the transaction is incoming.
      Returns:
      the sender of the transaction