Package net.sf.laja.example.car.behaviour

Examples of net.sf.laja.example.car.behaviour.Car


     *    defined in BusStateTemplate, are marked as optional and is not part of the mandatory attributes
     *    in the chained constructor but can by populated by the builder method 'withWeightInKilograms'.
     */
    public static void main(String... args) {
        // Use the chained constructor to create the car.
        Car volvo = Car.lengthInCentimeters(479).name("Volvo").owner(Owner.ssn(197506071234L).name("Bill")).color(RED).asCar();

        // Use the builder to create the car.
        Car saab = Car.build().withLengthInCentimeters(434).withName("Saab").withColor("Blue").withOwner(
                Owner.build().withSsn("197707071122").withName("Bull")).asCar();

        // Name and lengthInCentimeters are mandatory, weightInKilograms is optional.
        Bus bus = Bus.name("Some").lengthInCentimeters(5100).withWeightInKilograms(3200).asBus();

View Full Code Here

TOP

Related Classes of net.sf.laja.example.car.behaviour.Car

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.