Skip to content

Commit 51cba2b

Browse files
christophstroblmp911de
authored andcommitted
DATAREDIS-1143 - Delombok source files.
Original pull request: #530.
1 parent 67c4cc1 commit 51cba2b

File tree

74 files changed

+1097
-334
lines changed

Some content is hidden

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

74 files changed

+1097
-334
lines changed

Diff for: src/main/java/org/springframework/data/redis/connection/ClusterCommandExecutor.java

+38-9
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@
1515
*/
1616
package org.springframework.data.redis.connection;
1717

18-
import lombok.AccessLevel;
19-
import lombok.EqualsAndHashCode;
20-
import lombok.Getter;
21-
import lombok.RequiredArgsConstructor;
22-
2318
import java.util.*;
2419
import java.util.Map.Entry;
2520
import java.util.concurrent.ExecutionException;
@@ -657,14 +652,16 @@ public int compare(PositionalKey o1, PositionalKey o2) {
657652
* @author Christoph Strobl
658653
* @since 2.0.3
659654
*/
660-
@Getter
661-
@EqualsAndHashCode
662-
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
663655
private static class PositionalKey {
664656

665657
private final ByteArrayWrapper key;
666658
private final int position;
667659

660+
private PositionalKey(ByteArrayWrapper key, int position) {
661+
this.key = key;
662+
this.position = position;
663+
}
664+
668665
static PositionalKey of(byte[] key, int index) {
669666
return new PositionalKey(new ByteArrayWrapper(key), index);
670667
}
@@ -675,6 +672,35 @@ static PositionalKey of(byte[] key, int index) {
675672
byte[] getBytes() {
676673
return key.getArray();
677674
}
675+
676+
public ByteArrayWrapper getKey() {
677+
return this.key;
678+
}
679+
680+
public int getPosition() {
681+
return this.position;
682+
}
683+
684+
@Override
685+
public boolean equals(Object o) {
686+
if (this == o)
687+
return true;
688+
if (o == null || getClass() != o.getClass())
689+
return false;
690+
691+
PositionalKey that = (PositionalKey) o;
692+
693+
if (position != that.position)
694+
return false;
695+
return ObjectUtils.nullSafeEquals(key, that.key);
696+
}
697+
698+
@Override
699+
public int hashCode() {
700+
int result = ObjectUtils.nullSafeHashCode(key);
701+
result = 31 * result + position;
702+
return result;
703+
}
678704
}
679705

680706
/**
@@ -684,11 +710,14 @@ byte[] getBytes() {
684710
* @author Christoph Strobl
685711
* @since 2.0.3
686712
*/
687-
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
688713
private static class PositionalKeys implements Iterable<PositionalKey> {
689714

690715
private final List<PositionalKey> keys;
691716

717+
private PositionalKeys(List<PositionalKey> keys) {
718+
this.keys = keys;
719+
}
720+
692721
/**
693722
* Create an empty {@link PositionalKeys}.
694723
*/

Diff for: src/main/java/org/springframework/data/redis/connection/DefaultStringTuple.java

+22-3
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,15 @@
1515
*/
1616
package org.springframework.data.redis.connection;
1717

18-
import lombok.EqualsAndHashCode;
19-
2018
import org.springframework.data.redis.connection.RedisZSetCommands.Tuple;
2119
import org.springframework.data.redis.connection.StringRedisConnection.StringTuple;
20+
import org.springframework.util.ObjectUtils;
2221

2322
/**
2423
* Default implementation for {@link StringTuple} interface.
2524
*
2625
* @author Costin Leau
2726
*/
28-
@EqualsAndHashCode(callSuper = true)
2927
public class DefaultStringTuple extends DefaultTuple implements StringTuple {
3028

3129
private final String valueAsString;
@@ -60,4 +58,25 @@ public String getValueAsString() {
6058
public String toString() {
6159
return "DefaultStringTuple[value=" + getValueAsString() + ", score=" + getScore() + "]";
6260
}
61+
62+
@Override
63+
public boolean equals(Object o) {
64+
if (this == o)
65+
return true;
66+
if (o == null || getClass() != o.getClass())
67+
return false;
68+
if (!super.equals(o))
69+
return false;
70+
71+
DefaultStringTuple that = (DefaultStringTuple) o;
72+
73+
return ObjectUtils.nullSafeEquals(valueAsString, that.valueAsString);
74+
}
75+
76+
@Override
77+
public int hashCode() {
78+
int result = super.hashCode();
79+
result = 31 * result + ObjectUtils.nullSafeHashCode(valueAsString);
80+
return result;
81+
}
6382
}

Diff for: src/main/java/org/springframework/data/redis/connection/ReactiveRedisConnection.java

+41-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616
package org.springframework.data.redis.connection;
1717

18-
import lombok.Data;
1918
import reactor.core.publisher.Mono;
2019

2120
import java.io.Closeable;
@@ -27,6 +26,7 @@
2726
import org.springframework.data.redis.core.ScanOptions;
2827
import org.springframework.lang.Nullable;
2928
import org.springframework.util.Assert;
29+
import org.springframework.util.ObjectUtils;
3030

3131
/**
3232
* Redis connection using reactive infrastructure declaring entry points for reactive command execution.
@@ -346,19 +346,58 @@ public Range<Long> getRange() {
346346
* @param <I> command input type.
347347
* @param <O> command output type.
348348
*/
349-
@Data
350349
class CommandResponse<I, O> {
351350

352351
private final I input;
353352
private final @Nullable O output;
354353

354+
public CommandResponse(I input, O output) {
355+
this.input = input;
356+
this.output = output;
357+
}
358+
355359
/**
356360
* @return {@literal true} if the response is present. An absent {@link CommandResponse} maps to Redis
357361
* {@literal (nil)}.
358362
*/
359363
public boolean isPresent() {
360364
return true;
361365
}
366+
367+
public I getInput() {
368+
return this.input;
369+
}
370+
371+
@Nullable
372+
public O getOutput() {
373+
return this.output;
374+
}
375+
376+
@Override
377+
public boolean equals(Object o) {
378+
if (this == o)
379+
return true;
380+
if (o == null || getClass() != o.getClass())
381+
return false;
382+
383+
CommandResponse<?, ?> that = (CommandResponse<?, ?>) o;
384+
385+
if (!ObjectUtils.nullSafeEquals(input, that.input)) {
386+
return false;
387+
}
388+
return ObjectUtils.nullSafeEquals(output, that.output);
389+
}
390+
391+
@Override
392+
public int hashCode() {
393+
int result = ObjectUtils.nullSafeHashCode(input);
394+
result = 31 * result + ObjectUtils.nullSafeHashCode(output);
395+
return result;
396+
}
397+
398+
public String toString() {
399+
return "ReactiveRedisConnection.CommandResponse(input=" + this.getInput() + ", output=" + this.getOutput() + ")";
400+
}
362401
}
363402

364403
/**

Diff for: src/main/java/org/springframework/data/redis/connection/ReactiveSubscription.java

+44-3
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
*/
1616
package org.springframework.data.redis.connection;
1717

18-
import lombok.EqualsAndHashCode;
1918
import reactor.core.publisher.Flux;
2019
import reactor.core.publisher.Mono;
2120

2221
import java.nio.ByteBuffer;
2322
import java.util.Set;
2423

2524
import org.springframework.util.Assert;
25+
import org.springframework.util.ObjectUtils;
2626

2727
/**
2828
* Subscription for Redis channels using reactive infrastructure. A {@link ReactiveSubscription} allows subscribing to
@@ -155,7 +155,6 @@ interface Message<C, M> {
155155
* @author Christoph Strobl
156156
* @since 2.1
157157
*/
158-
@EqualsAndHashCode
159158
class ChannelMessage<C, M> implements Message<C, M> {
160159

161160
private final C channel;
@@ -194,6 +193,28 @@ public M getMessage() {
194193
return message;
195194
}
196195

196+
@Override
197+
public boolean equals(Object o) {
198+
if (this == o)
199+
return true;
200+
if (o == null || getClass() != o.getClass())
201+
return false;
202+
203+
ChannelMessage<?, ?> that = (ChannelMessage<?, ?>) o;
204+
205+
if (!ObjectUtils.nullSafeEquals(channel, that.channel)) {
206+
return false;
207+
}
208+
return ObjectUtils.nullSafeEquals(message, that.message);
209+
}
210+
211+
@Override
212+
public int hashCode() {
213+
int result = ObjectUtils.nullSafeHashCode(channel);
214+
result = 31 * result + ObjectUtils.nullSafeHashCode(message);
215+
return result;
216+
}
217+
197218
@Override
198219
public String toString() {
199220
return "ChannelMessage {" + "channel=" + channel + ", message=" + message + '}';
@@ -210,7 +231,6 @@ public String toString() {
210231
* @author Christoph Strobl
211232
* @since 2.1
212233
*/
213-
@EqualsAndHashCode(callSuper = true)
214234
class PatternMessage<P, C, M> extends ChannelMessage<C, M> {
215235

216236
private final P pattern;
@@ -239,6 +259,27 @@ public P getPattern() {
239259
return pattern;
240260
}
241261

262+
@Override
263+
public boolean equals(Object o) {
264+
if (this == o)
265+
return true;
266+
if (o == null || getClass() != o.getClass())
267+
return false;
268+
if (!super.equals(o))
269+
return false;
270+
271+
PatternMessage<?, ?, ?> that = (PatternMessage<?, ?, ?>) o;
272+
273+
return ObjectUtils.nullSafeEquals(pattern, that.pattern);
274+
}
275+
276+
@Override
277+
public int hashCode() {
278+
int result = super.hashCode();
279+
result = 31 * result + ObjectUtils.nullSafeHashCode(pattern);
280+
return result;
281+
}
282+
242283
@Override
243284
public String toString() {
244285
return "PatternMessage{" + "channel=" + getChannel() + ", pattern=" + pattern + ", message=" + getMessage() + '}';

Diff for: src/main/java/org/springframework/data/redis/connection/RedisGeoCommands.java

+50-5
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
*/
1616
package org.springframework.data.redis.connection;
1717

18-
import lombok.Data;
19-
import lombok.RequiredArgsConstructor;
20-
2118
import java.util.LinkedHashSet;
2219
import java.util.List;
2320
import java.util.Map;
@@ -355,12 +352,60 @@ protected GeoRadiusCommandArgs clone() {
355352
* @param <T>
356353
* @since 1.8
357354
*/
358-
@Data
359-
@RequiredArgsConstructor
360355
class GeoLocation<T> {
361356

362357
private final T name;
363358
private final Point point;
359+
360+
public GeoLocation(T name, Point point) {
361+
this.name = name;
362+
this.point = point;
363+
}
364+
365+
public T getName() {
366+
return this.name;
367+
}
368+
369+
public Point getPoint() {
370+
return this.point;
371+
}
372+
373+
public boolean equals(final Object o) {
374+
if (o == this)
375+
return true;
376+
if (!(o instanceof GeoLocation))
377+
return false;
378+
final GeoLocation<?> other = (GeoLocation<?>) o;
379+
if (!other.canEqual((Object) this))
380+
return false;
381+
final Object this$name = this.getName();
382+
final Object other$name = other.getName();
383+
if (this$name == null ? other$name != null : !this$name.equals(other$name))
384+
return false;
385+
final Object this$point = this.getPoint();
386+
final Object other$point = other.getPoint();
387+
if (this$point == null ? other$point != null : !this$point.equals(other$point))
388+
return false;
389+
return true;
390+
}
391+
392+
protected boolean canEqual(final Object other) {
393+
return other instanceof GeoLocation;
394+
}
395+
396+
public int hashCode() {
397+
final int PRIME = 59;
398+
int result = 1;
399+
final Object $name = this.getName();
400+
result = result * PRIME + ($name == null ? 43 : $name.hashCode());
401+
final Object $point = this.getPoint();
402+
result = result * PRIME + ($point == null ? 43 : $point.hashCode());
403+
return result;
404+
}
405+
406+
public String toString() {
407+
return "RedisGeoCommands.GeoLocation(name=" + this.getName() + ", point=" + this.getPoint() + ")";
408+
}
364409
}
365410

366411
/**

0 commit comments

Comments
 (0)