AttributeBuilder.java
1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package com.srh.api.builder;
import com.srh.api.model.Attribute;
import com.srh.api.model.Item;
import com.srh.api.model.TypeAttribute;
import com.srh.api.model.TypeItem;
import java.util.List;
public final class AttributeBuilder {
private Integer id;
private String name;
private String value;
private TypeAttribute type;
private List<Item> itens;
private List<TypeItem> typeItens;
private AttributeBuilder() {
}
public static AttributeBuilder anAttribute() {
return new AttributeBuilder();
}
public AttributeBuilder withId(Integer id) {
this.id = id;
return this;
}
public AttributeBuilder withName(String name) {
this.name = name;
return this;
}
public AttributeBuilder withValue(String value) {
this.value = value;
return this;
}
public AttributeBuilder withType(TypeAttribute type) {
this.type = type;
return this;
}
public AttributeBuilder withItens(List<Item> itens) {
this.itens = itens;
return this;
}
public AttributeBuilder withTypeItens(List<TypeItem> typeItens) {
this.typeItens = typeItens;
return this;
}
public Attribute build() {
Attribute attribute = new Attribute();
attribute.setId(id);
attribute.setName(name);
attribute.setValue(value);
attribute.setType(type);
attribute.setItens(itens);
attribute.setTypeItens(typeItens);
return attribute;
}
}