Skip to content

Commit 86db7fa

Browse files
authored
Merge pull request #3598 from ebean-orm/feature/tidy-QueryCacheEntry
Tidy QueryCacheEntry, final class and use accessors
2 parents 964b3cc + e48b327 commit 86db7fa

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

ebean-api/src/main/java/io/ebean/cache/QueryCacheEntry.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* the query cache entry is treated as invalid.
1212
* </p>
1313
*/
14-
public class QueryCacheEntry {
14+
public final class QueryCacheEntry {
1515

1616
private final Object value;
1717
private final Set<String> dependentTables;
@@ -33,21 +33,21 @@ public QueryCacheEntry(Object value, Set<String> dependentTables, Instant timest
3333
/**
3434
* Return the actual query result.
3535
*/
36-
public Object getValue() {
36+
public Object value() {
3737
return value;
3838
}
3939

4040
/**
4141
* Return the tables the query result is dependent on.
4242
*/
43-
public Set<String> getDependentTables() {
43+
public Set<String> dependentTables() {
4444
return dependentTables;
4545
}
4646

4747
/**
4848
* Return the timestamp used to check for modifications on the dependent tables.
4949
*/
50-
public Instant getTimestamp() {
50+
public Instant timestamp() {
5151
return timestamp;
5252
}
5353
}

ebean-core/src/main/java/io/ebeaninternal/server/cache/DefaultServerQueryCache.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public DefaultServerQueryCache(DefaultServerCacheConfig config) {
2323

2424
@Override
2525
protected Object unwrapEntry(CacheEntry entry) {
26-
return ((QueryCacheEntry) entry.getValue()).getValue();
26+
return ((QueryCacheEntry) entry.getValue()).value();
2727
}
2828

2929
@Override

ebean-core/src/main/java/io/ebeaninternal/server/transaction/TableModState.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ boolean isValid(Set<String> tables, Instant sinceTime) {
6060

6161
@Override
6262
public boolean isValid(QueryCacheEntry entry) {
63-
Set<String> dependentTables = entry.getDependentTables();
63+
Set<String> dependentTables = entry.dependentTables();
6464
if (dependentTables != null && !dependentTables.isEmpty()) {
65-
return isValid(dependentTables, entry.getTimestamp());
65+
return isValid(dependentTables, entry.timestamp());
6666
}
6767
return true;
6868
}

0 commit comments

Comments
 (0)