[Minor] Added JsonElement service argument result objects

This commit is contained in:
Robert von Burg 2016-09-19 21:19:51 +02:00
parent d127a93ed7
commit 813c7bc13d
2 changed files with 50 additions and 0 deletions

View File

@ -0,0 +1,19 @@
package li.strolch.rest.util;
import com.google.gson.JsonElement;
import li.strolch.service.api.AbstractService;
import li.strolch.service.api.ServiceArgument;
/**
* A {@link ServiceArgument} which takes a {@link JsonElement} as the input for a {@link AbstractService}. This is often
* used in conjunction with REST APIs
*
* @author Robert von Burg <eitch@eitchnet.ch>
*/
public class JsonServiceArgument extends ServiceArgument {
private static final long serialVersionUID = 1L;
public String baseUrl;
public String objectId;
public JsonElement jsonElement;
}

View File

@ -0,0 +1,31 @@
package li.strolch.rest.util;
import com.google.gson.JsonElement;
import li.strolch.service.api.AbstractService;
import li.strolch.service.api.ServiceResult;
import li.strolch.service.api.ServiceResultState;
/**
* A {@link ServiceResult} which defines the result of an {@link AbstractService} to be a {@link JsonElement}. This is
* often used in conjunction with REST APIs.
*
* @author Robert von Burg <eitch@eitchnet.ch>
*/
public class JsonServiceResult extends ServiceResult {
private static final long serialVersionUID = 1L;
private JsonElement result;
public JsonServiceResult() {
// do nothing
}
public JsonServiceResult(JsonElement result) {
super(ServiceResultState.SUCCESS);
this.result = result;
}
public JsonElement getResult() {
return this.result;
}
}