Skip to content

Commit f3c63f0

Browse files
committed
GH-2763 - De-Lombok all the things.
Closes #2763
1 parent b51d7ba commit f3c63f0

File tree

154 files changed

+7388
-1214
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+7388
-1214
lines changed

lombok.config

-2
This file was deleted.

pom.xml

-12
Original file line numberDiff line numberDiff line change
@@ -523,18 +523,6 @@
523523
<artifactId>maven-jar-plugin</artifactId>
524524
<version>${maven-jar-plugin.version}</version>
525525
</plugin>
526-
<plugin>
527-
<groupId>org.projectlombok</groupId>
528-
<artifactId>lombok-maven-plugin</artifactId>
529-
<dependencies>
530-
<dependency>
531-
<!-- See https://github.com/awhitford/lombok.maven/issues/34 -->
532-
<groupId>org.projectlombok</groupId>
533-
<artifactId>lombok</artifactId>
534-
<version>${lombok}</version>
535-
</dependency>
536-
</dependencies>
537-
</plugin>
538526
<plugin>
539527
<groupId>org.codehaus.mojo</groupId>
540528
<artifactId>flatten-maven-plugin</artifactId>

src/test/java/org/springframework/data/neo4j/core/mapping/callback/ImmutableSample.java

+88-16
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,99 @@
1515
*/
1616
package org.springframework.data.neo4j.core.mapping.callback;
1717

18-
import lombok.AllArgsConstructor;
19-
import lombok.NoArgsConstructor;
20-
import lombok.Value;
21-
import lombok.With;
22-
23-
import java.util.Date;
24-
2518
import org.springframework.data.annotation.CreatedDate;
2619
import org.springframework.data.annotation.Id;
2720
import org.springframework.data.annotation.LastModifiedDate;
2821

22+
import java.util.Date;
23+
2924
/**
3025
* @author Michael J. Simons
3126
*/
32-
@Value
33-
@With
34-
@AllArgsConstructor
35-
@NoArgsConstructor(force = true)
36-
public class ImmutableSample {
37-
38-
@Id String id;
39-
@CreatedDate Date created;
40-
@LastModifiedDate Date modified;
27+
public final class ImmutableSample {
28+
29+
@Id
30+
private final String id;
31+
@CreatedDate
32+
private final Date created;
33+
@LastModifiedDate
34+
private final Date modified;
35+
36+
public ImmutableSample(String id, Date created, Date modified) {
37+
this.id = id;
38+
this.created = created;
39+
this.modified = modified;
40+
}
41+
42+
public ImmutableSample() {
43+
this.id = null;
44+
this.created = null;
45+
this.modified = null;
46+
}
47+
48+
public String getId() {
49+
return this.id;
50+
}
51+
52+
public Date getCreated() {
53+
return this.created;
54+
}
55+
56+
public Date getModified() {
57+
return this.modified;
58+
}
59+
60+
public boolean equals(final Object o) {
61+
if (o == this) {
62+
return true;
63+
}
64+
if (!(o instanceof ImmutableSample)) {
65+
return false;
66+
}
67+
final ImmutableSample other = (ImmutableSample) o;
68+
final Object this$id = this.getId();
69+
final Object other$id = other.getId();
70+
if (this$id == null ? other$id != null : !this$id.equals(other$id)) {
71+
return false;
72+
}
73+
final Object this$created = this.getCreated();
74+
final Object other$created = other.getCreated();
75+
if (this$created == null ? other$created != null : !this$created.equals(other$created)) {
76+
return false;
77+
}
78+
final Object this$modified = this.getModified();
79+
final Object other$modified = other.getModified();
80+
if (this$modified == null ? other$modified != null : !this$modified.equals(other$modified)) {
81+
return false;
82+
}
83+
return true;
84+
}
85+
86+
public int hashCode() {
87+
final int PRIME = 59;
88+
int result = 1;
89+
final Object $id = this.getId();
90+
result = result * PRIME + ($id == null ? 43 : $id.hashCode());
91+
final Object $created = this.getCreated();
92+
result = result * PRIME + ($created == null ? 43 : $created.hashCode());
93+
final Object $modified = this.getModified();
94+
result = result * PRIME + ($modified == null ? 43 : $modified.hashCode());
95+
return result;
96+
}
97+
98+
public String toString() {
99+
return "ImmutableSample(id=" + this.getId() + ", created=" + this.getCreated() + ", modified=" + this.getModified() + ")";
100+
}
101+
102+
public ImmutableSample withId(String newId) {
103+
return this.id == newId ? this : new ImmutableSample(newId, this.created, this.modified);
104+
}
105+
106+
public ImmutableSample withCreated(Date newCreated) {
107+
return this.created == newCreated ? this : new ImmutableSample(this.id, newCreated, this.modified);
108+
}
109+
110+
public ImmutableSample withModified(Date newModified) {
111+
return this.modified == newModified ? this : new ImmutableSample(this.id, this.created, newModified);
112+
}
41113
}

src/test/java/org/springframework/data/neo4j/integration/imperative/Neo4jTemplateIT.java

+92-20
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,6 @@
1515
*/
1616
package org.springframework.data.neo4j.integration.imperative;
1717

18-
import static org.assertj.core.api.Assertions.assertThat;
19-
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
20-
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
21-
22-
import lombok.Data;
23-
24-
import java.util.ArrayList;
25-
import java.util.Arrays;
26-
import java.util.Collection;
27-
import java.util.Collections;
28-
import java.util.HashMap;
29-
import java.util.List;
30-
import java.util.Map;
31-
import java.util.Optional;
32-
import java.util.function.BiPredicate;
33-
import java.util.function.Function;
34-
3518
import org.junit.jupiter.api.BeforeEach;
3619
import org.junit.jupiter.api.Test;
3720
import org.neo4j.cypherdsl.core.Cypher;
@@ -50,7 +33,6 @@
5033
import org.springframework.context.annotation.Configuration;
5134
import org.springframework.dao.IncorrectResultSizeDataAccessException;
5235
import org.springframework.data.mapping.PropertyPath;
53-
import org.springframework.data.neo4j.test.Neo4jImperativeTestConfiguration;
5436
import org.springframework.data.neo4j.core.DatabaseSelectionProvider;
5537
import org.springframework.data.neo4j.core.Neo4jTemplate;
5638
import org.springframework.data.neo4j.core.mapping.Neo4jPersistentProperty;
@@ -63,10 +45,26 @@
6345
import org.springframework.data.neo4j.integration.shared.common.ThingWithGeneratedId;
6446
import org.springframework.data.neo4j.test.BookmarkCapture;
6547
import org.springframework.data.neo4j.test.Neo4jExtension.Neo4jConnectionSupport;
48+
import org.springframework.data.neo4j.test.Neo4jImperativeTestConfiguration;
6649
import org.springframework.data.neo4j.test.Neo4jIntegrationTest;
6750
import org.springframework.transaction.PlatformTransactionManager;
6851
import org.springframework.transaction.annotation.EnableTransactionManagement;
6952

53+
import java.util.ArrayList;
54+
import java.util.Arrays;
55+
import java.util.Collection;
56+
import java.util.Collections;
57+
import java.util.HashMap;
58+
import java.util.List;
59+
import java.util.Map;
60+
import java.util.Optional;
61+
import java.util.function.BiPredicate;
62+
import java.util.function.Function;
63+
64+
import static org.assertj.core.api.Assertions.assertThat;
65+
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
66+
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
67+
7068
/**
7169
* @author Gerrit Meier
7270
* @author Michael J. Simons
@@ -354,14 +352,88 @@ private static BiPredicate<PropertyPath, Neo4jPersistentProperty> create2LevelPr
354352
return predicate;
355353
}
356354

357-
@Data
358355
static class DtoPersonProjection {
359356

360-
/** The ID is required in a project that should be saved. */
357+
/**
358+
* The ID is required in a project that should be saved.
359+
*/
361360
private final Long id;
362361

363362
private String lastName;
364363
private String firstName;
364+
365+
DtoPersonProjection(Long id) {
366+
this.id = id;
367+
}
368+
369+
public Long getId() {
370+
return this.id;
371+
}
372+
373+
public String getLastName() {
374+
return this.lastName;
375+
}
376+
377+
public String getFirstName() {
378+
return this.firstName;
379+
}
380+
381+
public void setLastName(String lastName) {
382+
this.lastName = lastName;
383+
}
384+
385+
public void setFirstName(String firstName) {
386+
this.firstName = firstName;
387+
}
388+
389+
public boolean equals(final Object o) {
390+
if (o == this) {
391+
return true;
392+
}
393+
if (!(o instanceof DtoPersonProjection)) {
394+
return false;
395+
}
396+
final DtoPersonProjection other = (DtoPersonProjection) o;
397+
if (!other.canEqual((Object) this)) {
398+
return false;
399+
}
400+
final Object this$id = this.getId();
401+
final Object other$id = other.getId();
402+
if (this$id == null ? other$id != null : !this$id.equals(other$id)) {
403+
return false;
404+
}
405+
final Object this$lastName = this.getLastName();
406+
final Object other$lastName = other.getLastName();
407+
if (this$lastName == null ? other$lastName != null : !this$lastName.equals(other$lastName)) {
408+
return false;
409+
}
410+
final Object this$firstName = this.getFirstName();
411+
final Object other$firstName = other.getFirstName();
412+
if (this$firstName == null ? other$firstName != null : !this$firstName.equals(other$firstName)) {
413+
return false;
414+
}
415+
return true;
416+
}
417+
418+
protected boolean canEqual(final Object other) {
419+
return other instanceof DtoPersonProjection;
420+
}
421+
422+
public int hashCode() {
423+
final int PRIME = 59;
424+
int result = 1;
425+
final Object $id = this.getId();
426+
result = result * PRIME + ($id == null ? 43 : $id.hashCode());
427+
final Object $lastName = this.getLastName();
428+
result = result * PRIME + ($lastName == null ? 43 : $lastName.hashCode());
429+
final Object $firstName = this.getFirstName();
430+
result = result * PRIME + ($firstName == null ? 43 : $firstName.hashCode());
431+
return result;
432+
}
433+
434+
public String toString() {
435+
return "Neo4jTemplateIT.DtoPersonProjection(id=" + this.getId() + ", lastName=" + this.getLastName() + ", firstName=" + this.getFirstName() + ")";
436+
}
365437
}
366438

367439
@Test // GH-2215

0 commit comments

Comments
 (0)