Fixed getMandatory
This commit is contained in:
parent
ebeba09151
commit
8b92208774
|
@ -41,11 +41,7 @@ public class BaseRequest {
|
||||||
|
|
||||||
public static final String getMandatory(String param,Document params) throws InvalidPluginRequestException {
|
public static final String getMandatory(String param,Document params) throws InvalidPluginRequestException {
|
||||||
if(params==null || params.isEmpty()|| !params.containsKey(param)) throw new InvalidPluginRequestException("Missing mandatory parameter "+param);
|
if(params==null || params.isEmpty()|| !params.containsKey(param)) throw new InvalidPluginRequestException("Missing mandatory parameter "+param);
|
||||||
try {
|
return Serialization.convert(params.get(param),String.class);
|
||||||
return Serialization.write(params.get(param));
|
|
||||||
} catch (JsonProcessingException e) {
|
|
||||||
throw new InvalidPluginRequestException(e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public BaseRequest validate() throws InvalidPluginRequestException {
|
public BaseRequest validate() throws InvalidPluginRequestException {
|
||||||
|
|
Loading…
Reference in New Issue