This repository was archived by the owner on Feb 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 353
/
Copy pathConference.java
206 lines (172 loc) · 5.9 KB
/
Conference.java
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
/*
* Copyright 2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.example.data.elasticsearch;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.data.elasticsearch.core.geo.GeoPoint;
import java.lang.Object;
import java.time.Instant;
import java.util.List;
import static org.springframework.data.elasticsearch.annotations.FieldType.*;
@Document(indexName = "conference-index")
public class Conference {
private @Id
String id;
private String name;
private @Field(type = Date)
String date;
private GeoPoint location;
private List<String> keywords;
@CreatedDate
@Field(type = FieldType.Date, format = DateFormat.basic_date_time)
Instant createdAt;
@CreatedBy
String createdBy;
@LastModifiedDate
@Field(type = FieldType.Date, format= DateFormat.basic_date_time)
Instant modifiedAt;
@LastModifiedBy
String modifiedBy;
// do not remove it
public Conference() {
}
// do not remove it - work around for lombok generated constructor for all params
public Conference(String id, String name, String date, GeoPoint location, List<String> keywords) {
this.id = id;
this.name = name;
this.date = date;
this.location = location;
this.keywords = keywords;
}
public static ConferenceBuilder builder() {
return new ConferenceBuilder();
}
public String getId() {
return this.id;
}
public String getName() {
return this.name;
}
public String getDate() {
return this.date;
}
public GeoPoint getLocation() {
return this.location;
}
public List<String> getKeywords() {
return this.keywords;
}
public void setId(String id) {
this.id = id;
}
public void setName(String name) {
this.name = name;
}
public void setDate(String date) {
this.date = date;
}
public void setLocation(GeoPoint location) {
this.location = location;
}
public void setKeywords(List<String> keywords) {
this.keywords = keywords;
}
public boolean equals(final Object o) {
if (o == this) return true;
if (!(o instanceof Conference)) return false;
final Conference other = (Conference) o;
if (!other.canEqual((Object) this)) return false;
final Object this$id = this.id;
final Object other$id = other.id;
if (this$id == null ? other$id != null : !this$id.equals(other$id)) return false;
final Object this$name = this.name;
final Object other$name = other.name;
if (this$name == null ? other$name != null : !this$name.equals(other$name)) return false;
final Object this$date = this.date;
final Object other$date = other.date;
if (this$date == null ? other$date != null : !this$date.equals(other$date)) return false;
final Object this$location = this.location;
final Object other$location = other.location;
if (this$location == null ? other$location != null : !this$location.equals(other$location)) return false;
final Object this$keywords = this.keywords;
final Object other$keywords = other.keywords;
if (this$keywords == null ? other$keywords != null : !this$keywords.equals(other$keywords)) return false;
return true;
}
protected boolean canEqual(final Object other) {
return other instanceof Conference;
}
public int hashCode() {
final int PRIME = 59;
int result = 1;
final Object $id = this.id;
result = result * PRIME + ($id == null ? 43 : $id.hashCode());
final Object $name = this.name;
result = result * PRIME + ($name == null ? 43 : $name.hashCode());
final Object $date = this.date;
result = result * PRIME + ($date == null ? 43 : $date.hashCode());
final Object $location = this.location;
result = result * PRIME + ($location == null ? 43 : $location.hashCode());
final Object $keywords = this.keywords;
result = result * PRIME + ($keywords == null ? 43 : $keywords.hashCode());
return result;
}
public String toString() {
return "Conference(id=" + this.id + ", name=" + this.name + ", date=" + this.date + ", location=" + this.location + ", keywords=" + this.keywords + ")";
}
public static class ConferenceBuilder {
private String id;
private String name;
private String date;
private GeoPoint location;
private List<String> keywords;
ConferenceBuilder() {
}
public Conference.ConferenceBuilder id(String id) {
this.id = id;
return this;
}
public Conference.ConferenceBuilder name(String name) {
this.name = name;
return this;
}
public Conference.ConferenceBuilder date(String date) {
this.date = date;
return this;
}
public Conference.ConferenceBuilder location(GeoPoint location) {
this.location = location;
return this;
}
public Conference.ConferenceBuilder keywords(List<String> keywords) {
this.keywords = keywords;
return this;
}
public Conference build() {
return new Conference(id, name, date, location, keywords);
}
public String toString() {
return "Conference.ConferenceBuilder(id=" + this.id + ", name=" + this.name + ", date=" + this.date + ", location=" + this.location + ", keywords=" + this.keywords + ")";
}
}
}