Skip to content

Commit fe5e4ad

Browse files
author
gaohaoxiang
committed
merge
1 parent e8f0cdf commit fe5e4ad

File tree

2 files changed

+0
-48
lines changed

2 files changed

+0
-48
lines changed

openmessaging-api/src/main/java/io/openmessaging/KeyValue.java

-29
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,6 @@
3535
*/
3636
public interface KeyValue {
3737

38-
/**
39-
* Inserts or replaces {@code boolean} value for the specified key.
40-
*
41-
* @param key the key to be placed into this {@code KeyValue} object
42-
* @param value the value corresponding to <tt>key</tt>
43-
*/
44-
KeyValue put(String key, boolean value);
45-
4638
/**
4739
* Inserts or replaces {@code short} value for the specified key.
4840
*
@@ -83,27 +75,6 @@ public interface KeyValue {
8375
*/
8476
KeyValue put(String key, String value);
8577

86-
/**
87-
* Searches for the {@code boolean} property with the specified key in this {@code KeyValue} object. If the key is not
88-
* found in this property list, false is returned.
89-
*
90-
* @param key the property key
91-
* @return the value in this {@code KeyValue} object with the specified key value
92-
* @see #put(String, boolean)
93-
*/
94-
boolean getBoolean(String key);
95-
96-
/**
97-
* Searches for the {@code boolean} property with the specified key in this {@code KeyValue} object. If the key is not
98-
* found in this property list, false is returned.
99-
*
100-
* @param key the property key
101-
* @param defaultValue a default value
102-
* @return the value in this {@code KeyValue} object with the specified key value
103-
* @see #put(String, boolean)
104-
*/
105-
boolean getBoolean(String key, boolean defaultValue);
106-
10778
/**
10879
* Searches for the {@code short} property with the specified key in this {@code KeyValue} object. If the key is not
10980
* found in this property list, zero is returned.

openmessaging-api/src/main/java/io/openmessaging/internal/DefaultKeyValue.java

-19
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,6 @@
3131
public class DefaultKeyValue implements KeyValue {
3232
private Map<String, String> properties;
3333

34-
@Override
35-
public KeyValue put(String key, boolean value) {
36-
properties.put(key, String.valueOf(value));
37-
return this;
38-
}
39-
40-
@Override
41-
public boolean getBoolean(String key) {
42-
if (!properties.containsKey(key)) {
43-
return false;
44-
}
45-
return Boolean.valueOf(properties.get(key));
46-
}
47-
48-
@Override
49-
public boolean getBoolean(String key, boolean defaultValue) {
50-
return properties.containsKey(key) ? getBoolean(key) : defaultValue;
51-
}
52-
5334
@Override
5435
public int getShort(String key) {
5536
return 0;

0 commit comments

Comments
 (0)