do not throw generic exception in Parameter
This commit is contained in:
parent
50987d45fb
commit
caa64baa49
3 changed files with 11 additions and 9 deletions
|
@ -1,3 +1,3 @@
|
||||||
group = org.xbib
|
group = org.xbib
|
||||||
name = net
|
name = net
|
||||||
version = 4.5.0
|
version = 4.6.0
|
||||||
|
|
|
@ -3,4 +3,6 @@ handlers=java.util.logging.ConsoleHandler
|
||||||
java.util.logging.SimpleFormatter.format=%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS.%1$tL %4$-7s [%3$s] %5$s %6$s%n
|
java.util.logging.SimpleFormatter.format=%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS.%1$tL %4$-7s [%3$s] %5$s %6$s%n
|
||||||
java.util.logging.ConsoleHandler.level=ALL
|
java.util.logging.ConsoleHandler.level=ALL
|
||||||
java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
|
java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
|
||||||
jdk.event.security.level=INFO
|
jdk.event.security.level=OFF
|
||||||
|
javax.management.mbeanserver.level=OFF
|
||||||
|
javax.management.misc.level=OFF
|
||||||
|
|
|
@ -205,19 +205,22 @@ public class Parameter implements Iterable<Pair<String, Object>>, Comparable<Par
|
||||||
}
|
}
|
||||||
|
|
||||||
public Parameter get(Domain domain) throws ParameterException {
|
public Parameter get(Domain domain) throws ParameterException {
|
||||||
if (builder.parameterMap.containsKey(domain)) {
|
|
||||||
return builder.parameterMap.get(domain);
|
|
||||||
}
|
|
||||||
if (getDomain() == Domain.UNDEFINED) {
|
if (getDomain() == Domain.UNDEFINED) {
|
||||||
throw new ParameterException("undefined domain");
|
throw new ParameterException("undefined domain");
|
||||||
}
|
}
|
||||||
|
if (builder.parameterMap.containsKey(domain)) {
|
||||||
|
return builder.parameterMap.get(domain);
|
||||||
|
}
|
||||||
if (getDomain().equals(domain)) {
|
if (getDomain().equals(domain)) {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Object> getAll(String key, Domain domain) throws Exception {
|
public List<Object> getAll(String key, Domain domain) throws ParameterException {
|
||||||
|
if (getDomain() == Domain.UNDEFINED) {
|
||||||
|
throw new ParameterException("undefined domain");
|
||||||
|
}
|
||||||
Parameter parameter = null;
|
Parameter parameter = null;
|
||||||
if (builder.parameterMap.containsKey(domain)) {
|
if (builder.parameterMap.containsKey(domain)) {
|
||||||
parameter = builder.parameterMap.get(domain);
|
parameter = builder.parameterMap.get(domain);
|
||||||
|
@ -225,9 +228,6 @@ public class Parameter implements Iterable<Pair<String, Object>>, Comparable<Par
|
||||||
if (parameter != null) {
|
if (parameter != null) {
|
||||||
return parameter.getAll(key, domain);
|
return parameter.getAll(key, domain);
|
||||||
}
|
}
|
||||||
if (getDomain() == Domain.UNDEFINED) {
|
|
||||||
throw new ParameterException("undefined domain");
|
|
||||||
}
|
|
||||||
if (getDomain().equals(domain)) {
|
if (getDomain().equals(domain)) {
|
||||||
return builder.list.stream()
|
return builder.list.stream()
|
||||||
.filter(p -> p.getKey().equals(key))
|
.filter(p -> p.getKey().equals(key))
|
||||||
|
|
Loading…
Reference in a new issue