package nl.jft.logic.util.builder;

import nl.jft.common.rating.Rating;
import nl.jft.logic.participant.Title;
import nl.jft.logic.participant.impl.User;

/**
 * @author Lesley
 */
public final class UserBuilder {

    private int id;
    private String username;
    private Rating rating;
    private Title title;

    public UserBuilder withId(int id) {
        this.id = id;
        return this;
    }

    public UserBuilder withUsername(String username) {
        this.username = username;
        return this;
    }

    public UserBuilder withRating(Rating rating) {
        this.rating = rating;
        return this;
    }

    public UserBuilder withTitle(Title title) {
        this.title = title;
        return this;
    }

    public User build() {
        return new User(id, username, rating, title);
    }

}

@@ -65,16 +65,52 @@
 Rating;%0A
+import nl.jft.logic.LogicConstants;%0A
 import n
@@ -140,16 +140,16 @@
 .Title;%0A
-
 import n
@@ -182,16 +182,56 @@
 pl.User;
+%0Aimport nl.jft.logic.util.LogicTestUtil;
 %0A%0A/**%0A *
@@ -356,24 +356,24 @@
 ing rating;%0A
-
     private 
@@ -386,16 +386,224 @@
 title;%0A%0A
+    public UserBuilder() %7B%0A        id = LogicConstants.INTERNAL_ID;%0A        username = %22username%22;%0A        rating = LogicTestUtil.makeDefaultRating();%0A        title = LogicTestUtil.makeDefaultTitle();%0A    %7D%0A%0A
     publ

Insert default attributes in UserBuilder.