1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.forgerock.api.transform;
18
19 import java.util.Objects;
20
21 import org.forgerock.util.i18n.LocalizableString;
22
23 import io.swagger.models.properties.DateProperty;
24 import io.swagger.models.properties.Property;
25
26
27
28
29 class LocalizableDateProperty extends DateProperty implements LocalizableProperty<Property> {
30 private LocalizableString title;
31 private LocalizableString description;
32 private String defaultValue;
33
34 @Override
35 public LocalizableDateProperty title(LocalizableString title) {
36 this.title = title;
37 return this;
38 }
39
40 @Override
41 public LocalizableDateProperty description(LocalizableString desc) {
42 this.description = desc;
43 return this;
44 }
45
46 @Override
47 public LocalizableDateProperty title(String title) {
48 setTitle(title);
49 return this;
50 }
51
52 @Override
53 public void setTitle(String title) {
54 super.setTitle(title);
55 this.title = new LocalizableString(title);
56 }
57
58 @Override
59 public LocalizableDateProperty description(String description) {
60 setDescription(description);
61 return this;
62 }
63
64 @Override
65 public void setDescription(String description) {
66 super.setDescription(description);
67 this.description = new LocalizableString(description);
68 }
69
70 @Override
71 public LocalizableString getLocalizableTitle() {
72 return title;
73 }
74
75 @Override
76 public LocalizableString getLocalizableDescription() {
77 return description;
78 }
79
80
81
82
83
84
85 @Override
86 public void setDefault(String defaultValue) {
87 this.defaultValue = defaultValue;
88 }
89
90
91
92
93
94
95 public String getDefault() {
96 return defaultValue;
97 }
98
99 @Override
100 public boolean equals(final Object o) {
101 if (!super.equals(o)) {
102 return false;
103 }
104 if (!(o instanceof LocalizableDateProperty)) {
105 return false;
106 }
107 final LocalizableDateProperty other = (LocalizableDateProperty) o;
108 if (!Objects.equals(defaultValue, other.defaultValue)) {
109 return false;
110 }
111 if (!Objects.equals(title, other.title)) {
112 return false;
113 }
114 if (!Objects.equals(description, other.description)) {
115 return false;
116 }
117 return true;
118 }
119
120 @Override
121 public int hashCode() {
122 return Objects.hash(super.hashCode(), title, description, defaultValue);
123 }
124
125 }