rocks.voss.toniebox.beans.amazon.AmazonBean Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of toniebox-api Show documentation
Show all versions of toniebox-api Show documentation
API to handle request for the Toniebox
package rocks.voss.toniebox.beans.amazon;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.Data;
import java.io.IOException;
import java.io.Serializable;
@Data
public class AmazonBean implements Serializable {
private UrlBean url;
private String uuid;
public static AmazonBean createBean(String json) throws IOException {
ObjectMapper mapper = new ObjectMapper();
JsonNode jsonNode = mapper.readValue(json, JsonNode.class);
return mapper.treeToValue(jsonNode, AmazonBean.class);
}
}