Package net.sf.gluent.doc.fluentpatterns.basicbuilder.Person

Examples of net.sf.gluent.doc.fluentpatterns.basicbuilder.Person.PersonBuilder.firstName()


  @Test
  public void testBuilderCanBeReusedIfNothingIsRewritten() {
    PersonBuilder someMeikalainenWith = Person.with().lastName(
        "Meikäläinen");
    Person matti = someMeikalainenWith.firstName("Matti").birthYear(1973)
        .end();
    Person maija = someMeikalainenWith.firstName("Maija").birthYear(1976)
        .end();
    assertEquals("Matti Meikäläinen 1973", matti.toString());
    assertEquals("Maija Meikäläinen 1976", maija.toString());
View Full Code Here


  public void testBuilderCanBeReusedIfNothingIsRewritten() {
    PersonBuilder someMeikalainenWith = Person.with().lastName(
        "Meikäläinen");
    Person matti = someMeikalainenWith.firstName("Matti").birthYear(1973)
        .end();
    Person maija = someMeikalainenWith.firstName("Maija").birthYear(1976)
        .end();
    assertEquals("Matti Meikäläinen 1973", matti.toString());
    assertEquals("Maija Meikäläinen 1976", maija.toString());
  }
View Full Code Here

    PersonBuilder somePersonWith = Person.with()
        .firstName("defaultFirstName").lastName("defaultLastName")
        .birthYear(1900);
    PersonBuilder someMeikalainenWith = somePersonWith
        .lastName("Meikäläinen");
    Person mattiMeikalainen = someMeikalainenWith.firstName("Matti")
        .birthYear(1973).end();
    Person kalleKustaa = somePersonWith.firstName("Kalle")
        .lastName("Kustaa").end();
    assertEquals("Matti Meikäläinen 1973", mattiMeikalainen.toString());
    // note that 1973 leaked to kalleKustaa:
View Full Code Here

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.