com.twilio.taskrouter.TaskRouterResource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of twilio Show documentation
Show all versions of twilio Show documentation
Twilio Java Helper Library
package com.twilio.taskrouter;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
public abstract class TaskRouterResource {
/**
* Converts a resource to JSON.
*
* @return JSON representation of the resource
* @throws IOException if unable to transform to JSON
*/
public String toJson() throws IOException {
ObjectMapper mapper = new ObjectMapper();
ByteArrayOutputStream out = new ByteArrayOutputStream();
mapper.writeValue(out, this);
return out.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy