Skip to content

Commit

Permalink
Spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
SanHalacogluImproving committed Feb 23, 2024
1 parent d562038 commit 780e411
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 50 deletions.
9 changes: 4 additions & 5 deletions java/client/src/main/java/glide/api/BaseClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@
package glide.api;

import static glide.ffi.resolvers.SocketListenerResolver.getSocket;
import static redis_request.RedisRequestOuterClass.RequestType.Expire;
import static redis_request.RedisRequestOuterClass.RequestType.ExpireAt;
import static glide.utils.ArrayTransformUtils.castArray;
import static glide.utils.ArrayTransformUtils.convertMapToArgArray;
import static redis_request.RedisRequestOuterClass.RequestType.Decr;
import static redis_request.RedisRequestOuterClass.RequestType.DecrBy;
import static redis_request.RedisRequestOuterClass.RequestType.Del;
import static redis_request.RedisRequestOuterClass.RequestType.Exists;
import static redis_request.RedisRequestOuterClass.RequestType.Expire;
import static redis_request.RedisRequestOuterClass.RequestType.ExpireAt;
import static redis_request.RedisRequestOuterClass.RequestType.GetString;
import static redis_request.RedisRequestOuterClass.RequestType.PExpire;
import static redis_request.RedisRequestOuterClass.RequestType.PExpireAt;
import static redis_request.RedisRequestOuterClass.RequestType.HashDel;
import static redis_request.RedisRequestOuterClass.RequestType.HashExists;
import static redis_request.RedisRequestOuterClass.RequestType.HashGet;
Expand All @@ -26,6 +24,8 @@
import static redis_request.RedisRequestOuterClass.RequestType.IncrByFloat;
import static redis_request.RedisRequestOuterClass.RequestType.MGet;
import static redis_request.RedisRequestOuterClass.RequestType.MSet;
import static redis_request.RedisRequestOuterClass.RequestType.PExpire;
import static redis_request.RedisRequestOuterClass.RequestType.PExpireAt;
import static redis_request.RedisRequestOuterClass.RequestType.Ping;
import static redis_request.RedisRequestOuterClass.RequestType.SAdd;
import static redis_request.RedisRequestOuterClass.RequestType.SCard;
Expand All @@ -37,7 +37,6 @@

import glide.api.commands.ConnectionManagementCommands;
import glide.api.commands.GenericBaseCommands;
import glide.api.commands.GenericBaseCommands;
import glide.api.commands.HashCommands;
import glide.api.commands.SetCommands;
import glide.api.commands.StringCommands;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public interface GenericBaseCommands {
* </pre>
*/
CompletableFuture<Boolean> pexpireAt(
String key, long unixMilliseconds, ExpireOptions expireOptions);
String key, long unixMilliseconds, ExpireOptions expireOptions);

/**
* Returns the remaining time to live of <code>key</code> that has a timeout.
Expand Down
4 changes: 2 additions & 2 deletions java/client/src/test/java/glide/api/RedisClientTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
import static redis_request.RedisRequestOuterClass.RequestType.IncrBy;
import static redis_request.RedisRequestOuterClass.RequestType.IncrByFloat;
import static redis_request.RedisRequestOuterClass.RequestType.Info;
import static redis_request.RedisRequestOuterClass.RequestType.PExpire;
import static redis_request.RedisRequestOuterClass.RequestType.PExpireAt;
import static redis_request.RedisRequestOuterClass.RequestType.MGet;
import static redis_request.RedisRequestOuterClass.RequestType.MSet;
import static redis_request.RedisRequestOuterClass.RequestType.PExpire;
import static redis_request.RedisRequestOuterClass.RequestType.PExpireAt;
import static redis_request.RedisRequestOuterClass.RequestType.Ping;
import static redis_request.RedisRequestOuterClass.RequestType.SAdd;
import static redis_request.RedisRequestOuterClass.RequestType.SCard;
Expand Down
Empty file.
80 changes: 40 additions & 40 deletions java/client/src/test/java/glide/api/models/TransactionTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

import static glide.api.models.commands.SetOptions.RETURN_OLD_VALUE;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static redis_request.RedisRequestOuterClass.RequestType.Expire;
import static redis_request.RedisRequestOuterClass.RequestType.ExpireAt;
import static redis_request.RedisRequestOuterClass.RequestType.Decr;
import static redis_request.RedisRequestOuterClass.RequestType.DecrBy;
import static redis_request.RedisRequestOuterClass.RequestType.Del;
import static redis_request.RedisRequestOuterClass.RequestType.Exists;
import static redis_request.RedisRequestOuterClass.RequestType.Expire;
import static redis_request.RedisRequestOuterClass.RequestType.ExpireAt;
import static redis_request.RedisRequestOuterClass.RequestType.GetString;
import static redis_request.RedisRequestOuterClass.RequestType.HashDel;
import static redis_request.RedisRequestOuterClass.RequestType.HashExists;
Expand All @@ -22,10 +22,10 @@
import static redis_request.RedisRequestOuterClass.RequestType.IncrBy;
import static redis_request.RedisRequestOuterClass.RequestType.IncrByFloat;
import static redis_request.RedisRequestOuterClass.RequestType.Info;
import static redis_request.RedisRequestOuterClass.RequestType.PExpire;
import static redis_request.RedisRequestOuterClass.RequestType.PExpireAt;
import static redis_request.RedisRequestOuterClass.RequestType.MGet;
import static redis_request.RedisRequestOuterClass.RequestType.MSet;
import static redis_request.RedisRequestOuterClass.RequestType.PExpire;
import static redis_request.RedisRequestOuterClass.RequestType.PExpireAt;
import static redis_request.RedisRequestOuterClass.RequestType.Ping;
import static redis_request.RedisRequestOuterClass.RequestType.SAdd;
import static redis_request.RedisRequestOuterClass.RequestType.SCard;
Expand Down Expand Up @@ -157,63 +157,63 @@ public void transaction_builds_protobuf_request(BaseTransaction<?> transaction)

transaction.expire("key", 9L);
results.add(
Pair.of(Expire, ArgsArray.newBuilder().addArgs("key").addArgs(Long.toString(9L)).build()));
Pair.of(Expire, ArgsArray.newBuilder().addArgs("key").addArgs(Long.toString(9L)).build()));

transaction.expire("key", 99L, ExpireOptions.NEW_EXPIRY_GREATER_THAN_CURRENT);
results.add(
Pair.of(
Expire,
ArgsArray.newBuilder()
.addArgs("key")
.addArgs(Long.toString(99L))
.addArgs("GT")
.build()));
Pair.of(
Expire,
ArgsArray.newBuilder()
.addArgs("key")
.addArgs(Long.toString(99L))
.addArgs("GT")
.build()));

transaction.expireAt("key", 999L);
results.add(
Pair.of(
ExpireAt, ArgsArray.newBuilder().addArgs("key").addArgs(Long.toString(999L)).build()));
Pair.of(
ExpireAt, ArgsArray.newBuilder().addArgs("key").addArgs(Long.toString(999L)).build()));

transaction.expireAt("key", 9999L, ExpireOptions.NEW_EXPIRY_LESS_THAN_CURRENT);
results.add(
Pair.of(
ExpireAt,
ArgsArray.newBuilder()
.addArgs("key")
.addArgs(Long.toString(9999L))
.addArgs("LT")
.build()));
Pair.of(
ExpireAt,
ArgsArray.newBuilder()
.addArgs("key")
.addArgs(Long.toString(9999L))
.addArgs("LT")
.build()));

transaction.pexpire("key", 99999L);
results.add(
Pair.of(
PExpire, ArgsArray.newBuilder().addArgs("key").addArgs(Long.toString(99999L)).build()));
Pair.of(
PExpire, ArgsArray.newBuilder().addArgs("key").addArgs(Long.toString(99999L)).build()));

transaction.pexpire("key", 999999L, ExpireOptions.HAS_EXISTING_EXPIRY);
results.add(
Pair.of(
PExpire,
ArgsArray.newBuilder()
.addArgs("key")
.addArgs(Long.toString(999999L))
.addArgs("XX")
.build()));
Pair.of(
PExpire,
ArgsArray.newBuilder()
.addArgs("key")
.addArgs(Long.toString(999999L))
.addArgs("XX")
.build()));

transaction.pexpireAt("key", 9999999L);
results.add(
Pair.of(
PExpireAt,
ArgsArray.newBuilder().addArgs("key").addArgs(Long.toString(9999999L)).build()));
Pair.of(
PExpireAt,
ArgsArray.newBuilder().addArgs("key").addArgs(Long.toString(9999999L)).build()));

transaction.pexpireAt("key", 99999999L, ExpireOptions.HAS_NO_EXPIRY);
results.add(
Pair.of(
PExpireAt,
ArgsArray.newBuilder()
.addArgs("key")
.addArgs(Long.toString(99999999L))
.addArgs("NX")
.build()));
Pair.of(
PExpireAt,
ArgsArray.newBuilder()
.addArgs("key")
.addArgs(Long.toString(99999999L))
.addArgs("NX")
.build()));

transaction.ttl("key");
results.add(Pair.of(TTL, ArgsArray.newBuilder().addArgs("key").build()));
Expand Down
3 changes: 1 addition & 2 deletions java/integTest/src/test/java/glide/SharedCommandTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@
import glide.api.models.configuration.NodeAddress;
import glide.api.models.configuration.RedisClientConfiguration;
import glide.api.models.configuration.RedisClusterClientConfiguration;
import java.time.Instant;
import glide.api.models.exceptions.RequestException;
import java.time.Instant;
import java.util.List;
import java.util.UUID;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
Expand Down

0 comments on commit 780e411

Please sign in to comment.