parent
4f66087bf4
commit
2785cab596
2 changed files with 11 additions and 7 deletions
|
@ -119,4 +119,8 @@ public class ComponentModelScope implements Scope {
|
|||
throw new UnsupportedOperationException("Not implemented");
|
||||
}
|
||||
|
||||
public ComponentModel getComponentModel() {
|
||||
return componentConfig;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -85,22 +85,22 @@ public class ComponentModel implements Serializable {
|
|||
}
|
||||
|
||||
public String get(String key, String defaultValue) {
|
||||
String s = config.getFirst(key);
|
||||
String s = get(key);
|
||||
return s != null ? s : defaultValue;
|
||||
}
|
||||
|
||||
public int get(String key, int defaultValue) {
|
||||
String s = config.getFirst(key);
|
||||
String s = get(key);
|
||||
return s != null ? Integer.parseInt(s) : defaultValue;
|
||||
}
|
||||
|
||||
public long get(String key, long defaultValue) {
|
||||
String s = config.getFirst(key);
|
||||
String s = get(key);
|
||||
return s != null ? Long.parseLong(s) : defaultValue;
|
||||
}
|
||||
|
||||
public boolean get(String key, boolean defaultValue) {
|
||||
String s = config.getFirst(key);
|
||||
String s = get(key);
|
||||
return s != null ? Boolean.parseBoolean(s) : defaultValue;
|
||||
}
|
||||
|
||||
|
@ -109,15 +109,15 @@ public class ComponentModel implements Serializable {
|
|||
}
|
||||
|
||||
public void put(String key, int value) {
|
||||
config.putSingle(key, Integer.toString(value));
|
||||
put(key, Integer.toString(value));
|
||||
}
|
||||
|
||||
public void put(String key, long value) {
|
||||
config.putSingle(key, Long.toString(value));
|
||||
put(key, Long.toString(value));
|
||||
}
|
||||
|
||||
public void put(String key, boolean value) {
|
||||
config.putSingle(key, Boolean.toString(value));
|
||||
put(key, Boolean.toString(value));
|
||||
}
|
||||
|
||||
public boolean hasNote(String key) {
|
||||
|
|
Loading…
Reference in a new issue