Sfoglia il codice sorgente

Use strict types instead of var

pull/11/head
Kristijan Mitrovic 4 anni fa
parent
commit
0e7668bb4e
1 ha cambiato i file con 6 aggiunte e 6 eliminazioni
  1. +6
    -6
      wizard-server/src/main/java/org/cobbzilla/wizard/cache/redis/RedisService.java

+ 6
- 6
wizard-server/src/main/java/org/cobbzilla/wizard/cache/redis/RedisService.java Vedi File

@@ -101,7 +101,7 @@ public class RedisService {

public boolean exists(String key) { return __exists(prefix(key), 0); }
public boolean anyExists(Collection<String> keys) {
for (final var key : keys) {
for (final String key : keys) {
if (__exists(prefix(key), 0)) return true;
}
return false;
@@ -111,7 +111,7 @@ public class RedisService {
}

public <T> T getObject(String key, Class<T> clazz) {
final var json = __get(prefix(key), 0);
final String json = __get(prefix(key), 0);
return empty(json) ? null : fromJsonOrDie(decrypt(json), clazz);
}
public String get(String key) { return decrypt(__get(prefix(key), 0)); }
@@ -130,8 +130,8 @@ public class RedisService {
__set(prefix(key), encrypt(value), buildSetParams(nxxx, expx, time), 0);
}
public void set(String key, String value, String expx, long time) {
final var fullKey = prefix(key);
final var preparedValue = encrypt(value);
final String fullKey = prefix(key);
final String preparedValue = encrypt(value);
__set(fullKey, preparedValue, buildSetParams(XX, expx, time), 0);
__set(fullKey, preparedValue, buildSetParams(NX, expx, time), 0);
}
@@ -140,7 +140,7 @@ public class RedisService {
__set(prefix(key), value, buildSetParams(nxxx, expx, time), 0);
}
public void set_plaintext(String key, String value, String expx, long time) {
final var fullKey = prefix(key);
final String fullKey = prefix(key);
__set(fullKey, value, buildSetParams(XX, expx, time), 0);
__set(fullKey, value, buildSetParams(NX, expx, time), 0);
}
@@ -171,7 +171,7 @@ public class RedisService {
public Long del_withPrefix(String prefixedKey) { return __del(prefixedKey, 0); }
public Long del_matching(String keyMatch) {
Long count = 0L;
for (final var fullKey : keys(keyMatch)) {
for (final String fullKey : keys(keyMatch)) {
count += __del(fullKey, 0);
}
return count;


Caricamento…
Annulla
Salva