Package net.sf.laja.example.account.behaviour

Examples of net.sf.laja.example.account.behaviour.SourceAccount


     *   - SourceAccount         (behaviour)
     *   - DestinationAccount    (behaviour)
     *   - AccountStateTemplate  (state)
     */
    public static void main(String... args) {
        SourceAccount sourceAccount = Account.balance(1000).asSourceAccount();
        DestinationAccount destinationAccount = Account.balance(100).asDestinationAccount();

        System.out.println("=== before transaction ===");
        System.out.println(sourceAccount);
        System.out.println(destinationAccount);

        System.out.println("\n=== transfer 400 ===");
        sourceAccount.transferTo(destinationAccount, 400);

        System.out.println("\n=== after transaction ===");
        System.out.println(sourceAccount);
        System.out.println(destinationAccount);
    }
View Full Code Here

TOP

Related Classes of net.sf.laja.example.account.behaviour.SourceAccount

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.