uk.gov.service.notify.TemplateList Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of notifications-java-client Show documentation
Show all versions of notifications-java-client Show documentation
Use this client to send emails, text messages and letters using the GOV.UK Notify API.
package uk.gov.service.notify;
import org.json.JSONArray;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
public class TemplateList {
private final List templates;
public TemplateList(String content){
JSONObject data = new JSONObject(content);
templates = new ArrayList<>();
JSONArray templatesData = data.getJSONArray("templates");
for(int i = 0; i < templatesData.length(); i++){
JSONObject template = templatesData.getJSONObject(i);
templates.add(new Template(template));
}
}
public List getTemplates() {
return templates;
}
@Override
public String toString() {
return "TemplateList{" +
"templates=" + templates +
'}';
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy