Package ComplexMappingTest

Source Code of ComplexMappingTest.Customer

package ComplexMappingTest;

import ComplexMappingTest.Address;
import ComplexMappingTest.Array_Of_Address;
import DisplayProject.binding.beans.ExtendedPropertyChangeSupport;
import DisplayProject.binding.beans.Observable;
import Framework.DateTimeData;
import Framework.RuntimeProperties;
import Framework.TextData;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import java.lang.String;
import java.util.Random;

/**
* Customer<p>
* <p>
* @author Generated from Forte
* @since  19-Nov-2008
*/
@RuntimeProperties(isDistributed=false, isAnchored=false, isShared=false, isTransactional=false)
@SuppressWarnings("serial")
public class Customer
        implements Serializable, Observable
{

    // ----------
    // Attributes
    // ----------
    public PropertyChangeSupport qq_Listeners = new ExtendedPropertyChangeSupport(this, true);
    private DateTimeData dOB;
    private String firstName;
    private Array_Of_Address<Address> l_Address;
    private Address r_Address;
    private String surname;

    // ------------
    // Constructors
    // ------------
    public Customer() {
        // Explicitly call the superclass constructor to prevent the implicit call
        super();
        this.setDOB(new DateTimeData());
        this.setL_Address(new Array_Of_Address<Address>());

    }

    // ----------------------
    // Accessors and Mutators
    // ----------------------
    public void setDOB(DateTimeData dOB) {
        DateTimeData oldValue = this.dOB;
        this.dOB = dOB;
        this.qq_Listeners.firePropertyChange("DOB", oldValue, this.dOB);
    }

    public DateTimeData getDOB() {
        return this.dOB;
    }

    public void setFirstName(String firstName) {
        String oldValue = this.firstName;
        this.firstName = firstName;
        this.qq_Listeners.firePropertyChange("firstName", oldValue, this.firstName);
    }

    public String getFirstName() {
        return this.firstName;
    }

    public void setL_Address(Array_Of_Address<Address> l_Address) {
        Array_Of_Address<Address> oldValue = this.l_Address;
        this.l_Address = l_Address;
        this.qq_Listeners.firePropertyChange("l_Address", oldValue, this.l_Address);
    }

    public Array_Of_Address<Address> getL_Address() {
        return this.l_Address;
    }

    public void setR_Address(Address r_Address) {
        Address oldValue = this.r_Address;
        this.r_Address = r_Address;
        this.qq_Listeners.firePropertyChange("r_Address", oldValue, this.r_Address);
    }

    public Address getR_Address() {
        return this.r_Address;
    }

    public void setSurname(String surname) {
        String oldValue = this.surname;
        this.surname = surname;
        this.qq_Listeners.firePropertyChange("surname", oldValue, this.surname);
    }

    public String getSurname() {
        return this.surname;
    }

    // -------
    // Methods
    // -------
    public void addPropertyChangeListener(String property, PropertyChangeListener listener) {
        qq_Listeners.addPropertyChangeListener(property, listener);
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        qq_Listeners.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(String property, PropertyChangeListener listener) {
        qq_Listeners.removePropertyChangeListener(property, listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        qq_Listeners.removePropertyChangeListener(listener);
    }

    /**
     * create<p>
     * <p>
     * @return Customer
     */
    public Customer create() {
        Random x = new Random();
        switch (x.nextInt(65536) % 5) {
            case 0: {
                this.setFirstName("Bob");
                break;
            }
            case 1: {
                this.setFirstName("Peter");
                break;
            }
            case 2: {
                this.setFirstName("Susan");
                break;
            }
            case 3: {
                this.setFirstName("Michael");
                break;
            }
            case 4: {
                this.setFirstName("Peta");
                break;
            }
        }

        switch (x.nextInt(65536) % 5) {
            case 0: {
                this.setSurname("Jones");
                break;
            }
            case 1: {
                this.setSurname("Smith");
                break;
            }
            case 2: {
                this.setSurname("Hewett");
                break;
            }
            case 3: {
                this.setSurname("Lee");
                break;
            }
            case 4: {
                this.setSurname("Park");
                break;
            }
        }

        DateTimeData aDate = new DateTimeData();
        switch (x.nextInt(65536) % 5) {
            case 0: {
                aDate.setValue("01-Jan-1993 00:00:00");
                break;
            }
            case 1: {
                aDate.setValue("04-Apr-1993 00:00:00");
                break;
            }
            case 2: {
                aDate.setValue("19-Jun-1993 00:00:00");
                break;
            }
            case 3: {
                aDate.setValue("12-May-1993 00:00:00");
                break;
            }
            case 4: {
                aDate.setValue("18-Dec-1993 00:00:00");
                break;
            }
        }
        this.setDOB(aDate);
        this.setR_Address(new Address().create());

        int limit = (x.nextInt(65536) % 4)+1;
        int qq_localVector = limit;
        for (int i = 1; i <= qq_localVector; i++) {
            this.getL_Address().add(new Address().create());
        }

        return this;
    }

    /**
     * toString<p>
     * <p>
     * @return String
     */
    public String toString() {
        TextData aMsg = new TextData();
        aMsg.concat(this.getFirstName()).concat(" ").concat(this.getSurname()).concat(" [").concat(this.getDOB()).concat("] @ ");
        if (this.getR_Address() != null) {
            aMsg.concat(this.getR_Address().toString());
        }

        if (this.getL_Address() != null) {
            for (Address thisAddress : this.getL_Address()) {
                aMsg.concat("\n\t").concat(thisAddress.toString());
            }
        }

        return aMsg.getValue();
    }
// end class Customer
// c Pass 2 Conversion Time: 281 milliseconds
TOP

Related Classes of ComplexMappingTest.Customer

TOP
Copyright © 2018 www.massapi.com. 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.