Package account

Class AccountImplDefProg

java.lang.Object
account.AccountImplDefProg
All Implemented Interfaces:
IAccountDefProg

public class AccountImplDefProg
extends java.lang.Object
implements IAccountDefProg
  • Constructor Summary

    Constructors
    Constructor Description
    AccountImplDefProg​(int amount, java.lang.String owner, int min)  
  • Method Summary

    Modifier and Type Method Description
    int balance()  
    void deposit​(int amount)  
    java.lang.String getHolder()  
    int overdraft()  
    void setHolder​(java.lang.String newHolder)  
    void withdraw​(int amount)  
    void withdraw2​(int amount)  

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AccountImplDefProg

      public AccountImplDefProg​(int amount, java.lang.String owner, int min) throws org.valid4j.errors.ContractViolation
      Throws:
      org.valid4j.errors.ContractViolation
  • Method Details

    • balance

      public int balance()
      Specified by:
      balance in interface IAccountDefProg
    • deposit

      public void deposit​(int amount) throws org.valid4j.errors.ContractViolation
      Specified by:
      deposit in interface IAccountDefProg
      Throws:
      org.valid4j.errors.ContractViolation
    • withdraw2

      public void withdraw2​(int amount) throws exceptions.OverdraftException, exceptions.HolderException, exceptions.WrongAmountException, exceptions.InsufficientFundsException
      Throws:
      exceptions.OverdraftException
      exceptions.HolderException
      exceptions.WrongAmountException
      exceptions.InsufficientFundsException
    • withdraw

      public void withdraw​(int amount) throws exceptions.OverdraftException, exceptions.HolderException, exceptions.WrongAmountException, exceptions.InsufficientFundsException
      Specified by:
      withdraw in interface IAccountDefProg
      Throws:
      exceptions.OverdraftException
      exceptions.HolderException
      exceptions.WrongAmountException
      exceptions.InsufficientFundsException
    • getHolder

      public java.lang.String getHolder() throws org.valid4j.errors.ContractViolation
      Specified by:
      getHolder in interface IAccountDefProg
      Throws:
      org.valid4j.errors.ContractViolation
    • setHolder

      public void setHolder​(java.lang.String newHolder) throws org.valid4j.errors.ContractViolation
      Specified by:
      setHolder in interface IAccountDefProg
      Throws:
      org.valid4j.errors.ContractViolation
    • overdraft

      public int overdraft() throws org.valid4j.errors.ContractViolation
      Specified by:
      overdraft in interface IAccountDefProg
      Throws:
      org.valid4j.errors.ContractViolation