Last active
August 8, 2018 06:18
-
-
Save drulabs/1c9526320f4802fbc7540bf1ccbefa5a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NEFT: Transaction ... // class NEFT extends Transaction | |
class IMPS: Transaction ... // class IMPS extends Transaction | |
class RTGS: Transaction ... // class RTGS extends Transaction | |
val transaction: Transaction = getCurrentTransaction() | |
// Now we don't know the type of transaction. It could be either of NEFT, IMPS or RTGS | |
// So we need to identify the type of trsaction and process it accordingly | |
when (transaction) { | |
is NEFT -> transaction.processNEFT() | |
is IMPS -> transaction.processIMPS() | |
else -> println("No Processing required") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment