Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- package wow;
- /**
- *
- * @author Jackson
- */
- public class Personagem {
- private final String nome;
- private final String raca;
- private final String classe;
- private final String cor;
- public static class Builder {
- private final String nome;
- private final String raca;
- private String classe;
- private String cor;
- public Builder(String nome, String raca) {
- this.nome = nome;
- this.raca = raca;
- }
- public Builder classe(String val) {
- classe = val;
- return this;
- }
- public Builder cor(String val) {
- cor = val;
- return this;
- }
- public Personagem build() {
- return new Personagem(this);
- }
- }
- private Personagem(Builder builder) {
- nome = builder.nome;
- raca = builder.raca;
- classe = builder.classe;
- cor = builder.cor;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement