1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package org.primefaces.extensions.model.dynaform;
23
24 import java.util.Objects;
25
26
27
28
29
30
31
32
33 public class DynaFormLabel extends AbstractDynaFormElement {
34
35 private static final long serialVersionUID = 1L;
36
37 private final String value;
38 private final boolean escape;
39 private DynaFormControl forControl;
40 private String targetClientId;
41 private boolean targetRequired = false;
42 private boolean targetValid = true;
43 private String styleClass;
44
45 public DynaFormLabel(String value, boolean escape, int colspan, int rowspan, int row, int column, boolean extended) {
46 super(colspan, rowspan, row, column, extended);
47
48 this.value = value;
49 this.escape = escape;
50 }
51
52 public String getValue() {
53 return value;
54 }
55
56 public boolean isEscape() {
57 return escape;
58 }
59
60 public DynaFormControl getForControl() {
61 return forControl;
62 }
63
64 public void setForControl(DynaFormControl forControl) {
65 this.forControl = forControl;
66 }
67
68 public String getTargetClientId() {
69 return targetClientId;
70 }
71
72 public void setTargetClientId(String targetClientId) {
73 this.targetClientId = targetClientId;
74 }
75
76 public boolean isTargetRequired() {
77 return targetRequired;
78 }
79
80 public void setTargetRequired(boolean targetRequired) {
81 this.targetRequired = targetRequired;
82 }
83
84 public boolean isTargetValid() {
85 return targetValid;
86 }
87
88 public void setTargetValid(boolean targetValid) {
89 this.targetValid = targetValid;
90 }
91
92 public String getStyleClass() {
93 return styleClass;
94 }
95
96 public void setStyleClass(final String styleClass) {
97 this.styleClass = styleClass;
98 }
99
100 @Override
101 public String toString() {
102 return "DynaFormLabel{" + "value=" + value + ", escape=" + escape + ", forControl=" + forControl
103 + ", targetClientId=" + targetClientId + ", targetRequired=" + targetRequired
104 + ", targetValid=" + targetValid + ", styleClass=" + styleClass + '}';
105 }
106
107 @Override
108 public boolean equals(Object o) {
109 if (this == o) {
110 return true;
111 }
112 if (!(o instanceof DynaFormLabel)) {
113 return false;
114 }
115 if (!super.equals(o)) {
116 return false;
117 }
118 DynaFormLabel that = (DynaFormLabel) o;
119 return isEscape() == that.isEscape() &&
120 isTargetRequired() == that.isTargetRequired() &&
121 isTargetValid() == that.isTargetValid() &&
122 Objects.equals(getValue(), that.getValue()) &&
123 Objects.equals(getTargetClientId(), that.getTargetClientId()) &&
124 Objects.equals(getStyleClass(), that.getStyleClass());
125 }
126
127 @Override
128 public int hashCode() {
129 return Objects.hash(super.hashCode(), getValue(), isEscape(), getTargetClientId(), isTargetRequired(), isTargetValid(), getStyleClass());
130 }
131 }