Class Debt

  • All Implemented Interfaces:
    IDebt

    public class Debt
    extends java.lang.Object
    implements IDebt
    Author:
    Andi Hotz, (c) Sahits GmbH, 2014 Created on Dec 30, 2014
    • Field Detail

      • debitor

        private final ICitizen debitor
      • dueDate

        @NonNull
        private final java.time.LocalDateTime dueDate
      • interest

        private final double interest
      • amount

        private final int amount
      • loanTakeOut

        @NonNull
        private final java.time.LocalDateTime loanTakeOut
    • Constructor Detail

      • Debt

        public Debt()
    • Method Detail

      • getLoanedDuration

        public long getLoanedDuration​(java.time.LocalDateTime now)
        Description copied from interface: IDebt
        Retrieve the duration in full days since taking the loan.
        Specified by:
        getLoanedDuration in interface IDebt
        Parameters:
        now - date per which the number of days are to be calculated.
        Returns:
        number of days of the loan untill now
      • getTotalDuration

        public long getTotalDuration()
        Description copied from interface: IDebt
        Retrieve the total duration of the loan in days.
        Specified by:
        getTotalDuration in interface IDebt
        Returns:
        number of days from start until the due date.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object