From 97e9b3c47340e04cd936b4c3dd869343c77b2559 Mon Sep 17 00:00:00 2001 From: Rob Bygrave Date: Tue, 21 Sep 2021 15:01:01 +1200 Subject: [PATCH] #2383 - Refactor rename Pairs methods for consistency (that are expected to be used only internally) --- ebean-api/src/main/java/io/ebean/Pairs.java | 10 +++++----- .../server/expression/InPairsExpression.java | 12 ++++++------ .../basic/cache/TestCacheViaComplexNaturalKey3.java | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ebean-api/src/main/java/io/ebean/Pairs.java b/ebean-api/src/main/java/io/ebean/Pairs.java index a6847bf1e..f0f2fbd62 100644 --- a/ebean-api/src/main/java/io/ebean/Pairs.java +++ b/ebean-api/src/main/java/io/ebean/Pairs.java @@ -111,28 +111,28 @@ public final class Pairs { /** * Return the first property name. */ - public String getProperty0() { + public String property0() { return property0; } /** * Return the second property name. */ - public String getProperty1() { + public String property1() { return property1; } /** * Return all the value pairs. */ - public List getEntries() { + public List entries() { return Collections.unmodifiableList(entries); } /** * Return the separator character used with DB varchar concatenation to combine the 2 values. */ - public String getConcatSeparator() { + public String concatSeparator() { return concatSeparator; } @@ -155,7 +155,7 @@ public final class Pairs { /** * Return a suffix used with DB varchar concatenation to combine the 2 values. */ - public String getConcatSuffix() { + public String concatSuffix() { return concatSuffix; } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/expression/InPairsExpression.java b/ebean-core/src/main/java/io/ebeaninternal/server/expression/InPairsExpression.java index b5533b7ad..fc4df7029 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/expression/InPairsExpression.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/expression/InPairsExpression.java @@ -24,14 +24,14 @@ final class InPairsExpression extends AbstractExpression { private List concatBindValues; InPairsExpression(Pairs pairs, boolean not) { - super(pairs.getProperty0()); - this.property0 = pairs.getProperty0(); - this.property1 = pairs.getProperty1(); + super(pairs.property0()); + this.property0 = pairs.property0(); + this.property1 = pairs.property1(); // the entries might be modified on cache hit. - this.entries = pairs.getEntries(); + this.entries = pairs.entries(); this.not = not; - this.separator = pairs.getConcatSeparator(); - this.suffix = pairs.getConcatSuffix(); + this.separator = pairs.concatSeparator(); + this.suffix = pairs.concatSuffix(); } @Override diff --git a/ebean-test/src/test/java/org/tests/model/basic/cache/TestCacheViaComplexNaturalKey3.java b/ebean-test/src/test/java/org/tests/model/basic/cache/TestCacheViaComplexNaturalKey3.java index 0c84dc11f..70ccc6d1b 100644 --- a/ebean-test/src/test/java/org/tests/model/basic/cache/TestCacheViaComplexNaturalKey3.java +++ b/ebean-test/src/test/java/org/tests/model/basic/cache/TestCacheViaComplexNaturalKey3.java @@ -361,7 +361,7 @@ public class TestCacheViaComplexNaturalKey3 extends BaseTestCase { List sql = LoggedSql.stop(); - assertThat(pairs.getEntries()).hasSize(3); + assertThat(pairs.entries()).hasSize(3); assertThat(list).hasSize(3); assertNaturalKeyHitMiss(1, 2); @@ -404,7 +404,7 @@ public class TestCacheViaComplexNaturalKey3 extends BaseTestCase { List sql = LoggedSql.stop(); - assertThat(pairs.getEntries()).hasSize(3); + assertThat(pairs.entries()).hasSize(3); assertThat(list).hasSize(3); assertNaturalKeyHitMiss(1, 2);