Skip to content

Commit db05d11

Browse files
committed
JAVAMONEY-69: renamed isXXXBound to hasXXXBound.
1 parent 818f448 commit db05d11

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

src/main/java/javax/money/convert/ProviderContext.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public Set<RateType> getRateTypes() {
8585
* Returns the starting date/time this rate is valid. The result can also be
8686
* {@code null}, since it is possible, that an {@link ExchangeRate} does not
8787
* have starting validity range. This also can be queried by calling
88-
* {@link #isLowerBound()}.
88+
* {@link #hasLowerBound()}.
8989
* <p>
9090
* Basically all date time types that are available on a platform must be
9191
* supported. On SE this includes Date, Calendar and the new 310 types
@@ -105,7 +105,7 @@ public <T> T getValidFrom(Class<T> type) {
105105
* <p>
106106
* This is modelled as {@link Long} instaed of {@code long}, since it is
107107
* possible, that an {@link ExchangeRate} does not have starting validity
108-
* range. This also can be queried by calling {@link #isLowerBound()}.
108+
* range. This also can be queried by calling {@link #hasLowerBound()}.
109109
*
110110
* @return The UTC timestamp of the rate, defining valid from, or
111111
* {@code null}, if no starting validity constraint is set.
@@ -118,7 +118,7 @@ public Long getValidFromMillis() {
118118
* Returns the ending date/time this rate is valid. The result can also be
119119
* {@code null}, since it is possible, that an {@link ExchangeRate} does not
120120
* have ending validity range. This also can be queried by calling
121-
* {@link #isUpperBound()}.
121+
* {@link #hasUpperBound()}.
122122
* <p>
123123
* Basically all date time types that are available on a platform must be
124124
* supported. On SE this includes Date, Calendar and the new 310 types
@@ -139,7 +139,7 @@ public <T> T getValidTo(Class<T> type) {
139139
* <p>
140140
* This is modelled as {@link Long} instaed of {@code long}, since it is
141141
* possible, that an {@link ExchangeRate} does not have ending validity
142-
* range. This also can be queried by calling {@link #isUpperBound()}.
142+
* range. This also can be queried by calling {@link #hasUpperBound()}.
143143
*
144144
* @return the duration of validity in milliseconds, or {@code null} if no
145145
* ending validity constraint is set.
@@ -175,7 +175,7 @@ public boolean isInScope(long timestamp) {
175175
* @return {@code true} if {@link #getValidFromMillis()} is not {@code null}
176176
* .
177177
*/
178-
public boolean isLowerBound() {
178+
public boolean hasLowerBound() {
179179
return getValidFrom(Long.class) != null;
180180
}
181181

@@ -185,7 +185,7 @@ public boolean isLowerBound() {
185185
*
186186
* @return {@code true} if {@link #getValidToMillis()} is not {@code null}.
187187
*/
188-
public boolean isUpperBound() {
188+
public boolean hasUpperBound() {
189189
return getValidTo(Long.class) != null;
190190
}
191191

src/test/java/javax/money/convert/ProviderContextTest.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
*/
1111
package javax.money.convert;
1212

13-
import org.junit.Ignore;
1413
import org.junit.Test;
1514

1615
import java.util.Date;
@@ -97,24 +96,24 @@ public void testIsInScope() throws Exception{
9796
@Test
9897
public void testIsLowerBound() throws Exception{
9998
ProviderContext ctx = new ProviderContext.Builder("myprov").setValidTo(222L).create();
100-
assertTrue(ctx.isUpperBound());
101-
assertFalse(ctx.isLowerBound());
99+
assertTrue(ctx.hasUpperBound());
100+
assertFalse(ctx.hasLowerBound());
102101
}
103102

104103
@Test
105104
public void testIsUpperBound() throws Exception{
106105
ProviderContext ctx = new ProviderContext.Builder("myprov").setValidFrom(222L).create();
107-
assertFalse(ctx.isUpperBound());
108-
assertTrue(ctx.isLowerBound());
106+
assertFalse(ctx.hasUpperBound());
107+
assertTrue(ctx.hasLowerBound());
109108
}
110109

111110
@Test
112111
public void testIsUpperLowerBound() throws Exception{
113112
ProviderContext ctx = new ProviderContext.Builder("myprov").setValidFrom(222L).setValidTo(230L).create();
114-
assertTrue(ctx.isUpperBound());
115-
assertTrue(ctx.isLowerBound());
113+
assertTrue(ctx.hasUpperBound());
114+
assertTrue(ctx.hasLowerBound());
116115
ctx = new ProviderContext.Builder("myprov").create();
117-
assertFalse(ctx.isUpperBound());
118-
assertFalse(ctx.isLowerBound());
116+
assertFalse(ctx.hasUpperBound());
117+
assertFalse(ctx.hasLowerBound());
119118
}
120119
}

0 commit comments

Comments
 (0)