[New] Added StringMapResult to use as a ServiceResult
This commit is contained in:
parent
757300e955
commit
99989de8b4
|
@ -0,0 +1,43 @@
|
||||||
|
package li.strolch.service;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import li.strolch.service.api.ServiceResult;
|
||||||
|
import li.strolch.service.api.ServiceResultState;
|
||||||
|
|
||||||
|
public class StringMapResult extends ServiceResult {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private Map<String, String> map = new HashMap<>();
|
||||||
|
|
||||||
|
public StringMapResult(ServiceResultState state) {
|
||||||
|
super(state);
|
||||||
|
}
|
||||||
|
|
||||||
|
public StringMapResult(ServiceResultState state, String msg) {
|
||||||
|
super(state, msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public StringMapResult(String key, String value) {
|
||||||
|
super(ServiceResultState.SUCCESS);
|
||||||
|
this.map = new HashMap<>();
|
||||||
|
this.map.put(key, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public StringMapResult(String key1, String value1, String key2, String value2) {
|
||||||
|
super(ServiceResultState.SUCCESS);
|
||||||
|
this.map = new HashMap<>();
|
||||||
|
this.map.put(key1, value1);
|
||||||
|
this.map.put(key2, value2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, String> getMap() {
|
||||||
|
return this.map;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void put(String key, String value) {
|
||||||
|
this.map.put(key, value);
|
||||||
|
}
|
||||||
|
}
|
|
@ -10,8 +10,12 @@ public class StrolchRootElementResult extends ServiceResult {
|
||||||
|
|
||||||
private StrolchRootElement rootElement;
|
private StrolchRootElement rootElement;
|
||||||
|
|
||||||
public StrolchRootElementResult() {
|
public StrolchRootElementResult(ServiceResultState state) {
|
||||||
//
|
super(state);
|
||||||
|
}
|
||||||
|
|
||||||
|
public StrolchRootElementResult(ServiceResultState state, String msg) {
|
||||||
|
super(state, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
public StrolchRootElementResult(StrolchRootElement rootElement) {
|
public StrolchRootElementResult(StrolchRootElement rootElement) {
|
||||||
|
|
Loading…
Reference in New Issue