Search in sources :

Example 1 with Phone

use of jodd.json.mock.Phone in project jodd by oblac.

the class DataCreator method createJodder.

public Person createJodder() {
    Address home = new Address("173 Hackers Drive", "New York", "NY", new Zipcode("123123"));
    Address work = new Address("42 Computer Center", "Earth", "Milkiway", new Zipcode("42"));
    Phone pagerPhone = new Phone(PhoneNumberType.PAGER, "123 555-1234");
    Phone cellPhone = new Phone(PhoneNumberType.MOBILE, "770 777 5432");
    Calendar cal = Calendar.getInstance();
    cal.set(1988, Calendar.NOVEMBER, 23, 8, 11);
    Person charlie = new Person("Igor", "Spasic", cal.getTime(), home, work);
    cal = Calendar.getInstance();
    cal.set(1993, Calendar.JUNE, 6, 8, 11);
    charlie.setFirstBaseBallGame(new Timestamp(cal.getTime().getTime()));
    charlie.getPhones().add(pagerPhone);
    charlie.getPhones().add(cellPhone);
    charlie.getHobbies().add("read");
    charlie.getHobbies().add("run");
    charlie.getHobbies().add("code");
    return charlie;
}
Also used : Address(jodd.json.mock.Address) Phone(jodd.json.mock.Phone) Calendar(java.util.Calendar) Zipcode(jodd.json.mock.Zipcode) Person(jodd.json.mock.Person) Timestamp(java.sql.Timestamp)

Example 2 with Phone

use of jodd.json.mock.Phone in project jodd by oblac.

the class DataCreator method createPedro.

public Person createPedro() {
    Zipcode pedroZip = new Zipcode("848485");
    Address pedroHome = new Address("12 Acrelèndia Way", "Rio de Janeiro", "Brazil", pedroZip);
    Address pedroWork = new Address("12 Acrelèndia Way", "Rio de Janeiro", "Brazil", pedroZip);
    Phone pedroPhone = new Phone(PhoneNumberType.MOBILE, "123 555 2323");
    Calendar pedroCal = Calendar.getInstance();
    pedroCal.set(1980, Calendar.APRIL, 12, 11, 45);
    Person pedro = new Person("Pedro", "Sanchez", pedroCal.getTime(), pedroHome, pedroWork);
    pedro.getPhones().add(pedroPhone);
    return pedro;
}
Also used : Address(jodd.json.mock.Address) Phone(jodd.json.mock.Phone) Calendar(java.util.Calendar) Zipcode(jodd.json.mock.Zipcode) Person(jodd.json.mock.Person)

Aggregations

Calendar (java.util.Calendar)2 Address (jodd.json.mock.Address)2 Person (jodd.json.mock.Person)2 Phone (jodd.json.mock.Phone)2 Zipcode (jodd.json.mock.Zipcode)2 Timestamp (java.sql.Timestamp)1