// Path: stickypunch-pushpackage/src/main/java/com/comandante/pushpackage/jackson/model/Website.java
// public class Website {
//     /*{
//     "websiteName": "Crunchy Punch",
//     "websitePushID": "web.com.purplestickypunch.demo",
//     "allowedDomains": ["https://purplestickypunch.com"]
//     "urlFormatString": "https://purplestickypunch.com/notificationreceived",
//     "authenticationToken": "8c7d540d-b440-4ab8-9d3a-e8f8252dea25",
//     "webServiceURL": "https://purplestickypunch.com/push"
//     }*/
//     private String websiteName;
//     private String websitePushId;
//     private List<String> allowedDomains;
//     private String urlFormatString;
//     private String authenticationToken;
//     private String webServiceUrl;
// 
//     public Website(String websiteName, String websitePushId, List<String> allowedDomains, String urlFormatString, String authenticationToken, String webServiceUrl) {
//         this.websiteName = websiteName;
//         this.websitePushId = websitePushId;
//         this.allowedDomains = allowedDomains;
//         this.urlFormatString = urlFormatString;
//         this.authenticationToken = authenticationToken;
//         this.webServiceUrl = webServiceUrl;
//     }
// 
//     public String getWebServiceUrl() {
//         return webServiceUrl;
//     }
// 
//     public void setWebServiceUrl(String webServiceUrl) {
//         this.webServiceUrl = webServiceUrl;
//     }
// 
//     public String getAuthenticationToken() {
//         return authenticationToken;
//     }
// 
//     public void setAuthenticationToken(String authenticationToken) {
//         this.authenticationToken = authenticationToken;
//     }
// 
//     public String getUrlFormatString() {
//         return urlFormatString;
//     }
// 
//     public void setUrlFormatString(String urlFormatString) {
//         this.urlFormatString = urlFormatString;
//     }
// 
//     public List<String> getAllowedDomains() {
//         return allowedDomains;
//     }
// 
//     public void setAllowedDomains(List<String> allowedDomains) {
//         this.allowedDomains = allowedDomains;
//     }
// 
//     public String getWebsitePushId() {
//         return websitePushId;
//     }
// 
//     public void setWebsitePushId(String websitePushId) {
//         this.websitePushId = websitePushId;
//     }
// 
//     public String getWebsiteName() {
//         return websiteName;
//     }
// 
//     public void setWebsiteName(String websiteName) {
//         this.websiteName = websiteName;
//     }
// }
// 
// Path: stickypunch-pushpackage/src/main/java/com/comandante/pushpackage/jackson/model/WebsiteBuilder.java
// public class WebsiteBuilder {
//     private String websiteName;
//     private String websitePushId;
//     private List<String> allowedDomains;
//     private String urlFormatString;
//     private String authenticationToken;
//     private String webServiceUrl;
// 
//     public WebsiteBuilder setWebsiteName(String websiteName) {
//         this.websiteName = websiteName;
//         return this;
//     }
// 
//     public WebsiteBuilder setWebsitePushId(String websitePushId) {
//         this.websitePushId = websitePushId;
//         return this;
//     }
// 
//     public WebsiteBuilder setAllowedDomains(List<String> allowedDomains) {
//         this.allowedDomains = allowedDomains;
//         return this;
//     }
// 
//     public WebsiteBuilder setUrlFormatString(String urlFormatString) {
//         this.urlFormatString = urlFormatString;
//         return this;
//     }
// 
//     public WebsiteBuilder setAuthenticationToken(String authenticationToken) {
//         this.authenticationToken = authenticationToken;
//         return this;
//     }
// 
//     public WebsiteBuilder setWebServiceUrl(String webServiceUrl) {
//         this.webServiceUrl = webServiceUrl;
//         return this;
//     }
// 
//     public Website build() {
//         return new Website(websiteName, websitePushId, allowedDomains, urlFormatString, authenticationToken, webServiceUrl);
//     }
// }


import com.comandante.pushpackage.jackson.model.Website;
import com.comandante.pushpackage.jackson.model.WebsiteBuilder;
import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.ObjectCodec;
import org.codehaus.jackson.map.DeserializationContext;
import org.codehaus.jackson.map.JsonDeserializer;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
package com.comandante.pushpackage.jackson;



public class WebsiteDeserializer extends JsonDeserializer<Website> {

    public static final WebsiteDeserializer INSTANCE = new WebsiteDeserializer();

    @Override
    public Website deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
        ObjectCodec oc = jp.getCodec();
        JsonNode nodes = oc.readTree(jp);
        String websitePushID = nodes.get("websitePushID").getTextValue();
        String websiteName = nodes.get("websiteName").getTextValue();
        List<String> allowedDomains = new ArrayList<String>();
        for (JsonNode node : nodes.get("allowedDomains")) {
            allowedDomains.add(node.getTextValue());
        }
        String urlFormatString = nodes.get("urlFormatString").getTextValue();
        String authenticationToken = nodes.get("authenticationToken").getTextValue();
        String webServiceUrl = nodes.get("webServiceURL").getTextValue();

        return new WebsiteBuilder()
                .setWebsiteName(websiteName)
                .setWebsitePushId(websitePushID)
                .setAllowedDomains(allowedDomains)
                .setUrlFormatString(urlFormatString)
// Path: stickypunch-pushpackage/src/main/java/com/comandante/pushpackage/jackson/model/Website.java
// public class Website {
//     /*{
//     "websiteName": "Crunchy Punch",
//     "websitePushID": "web.com.purplestickypunch.demo",
//     "allowedDomains": ["https://purplestickypunch.com"]
//     "urlFormatString": "https://purplestickypunch.com/notificationreceived",
//     "authenticationToken": "8c7d540d-b440-4ab8-9d3a-e8f8252dea25",
//     "webServiceURL": "https://purplestickypunch.com/push"
//     }*/
//     private String websiteName;
//     private String websitePushId;
//     private List<String> allowedDomains;
//     private String urlFormatString;
//     private String authenticationToken;
//     private String webServiceUrl;
// 
//     public Website(String websiteName, String websitePushId, List<String> allowedDomains, String urlFormatString, String authenticationToken, String webServiceUrl) {
//         this.websiteName = websiteName;
//         this.websitePushId = websitePushId;
//         this.allowedDomains = allowedDomains;
//         this.urlFormatString = urlFormatString;
//         this.authenticationToken = authenticationToken;
//         this.webServiceUrl = webServiceUrl;
//     }
// 
//     public String getWebServiceUrl() {
//         return webServiceUrl;
//     }
// 
//     public void setWebServiceUrl(String webServiceUrl) {
//         this.webServiceUrl = webServiceUrl;
//     }
// 
//     public String getAuthenticationToken() {
//         return authenticationToken;
//     }
// 
//     public void setAuthenticationToken(String authenticationToken) {
//         this.authenticationToken = authenticationToken;
//     }
// 
//     public String getUrlFormatString() {
//         return urlFormatString;
//     }
// 
//     public void setUrlFormatString(String urlFormatString) {
//         this.urlFormatString = urlFormatString;
//     }
// 
//     public List<String> getAllowedDomains() {
//         return allowedDomains;
//     }
// 
//     public void setAllowedDomains(List<String> allowedDomains) {
//         this.allowedDomains = allowedDomains;
//     }
// 
//     public String getWebsitePushId() {
//         return websitePushId;
//     }
// 
//     public void setWebsitePushId(String websitePushId) {
//         this.websitePushId = websitePushId;
//     }
// 
//     public String getWebsiteName() {
//         return websiteName;
//     }
// 
//     public void setWebsiteName(String websiteName) {
//         this.websiteName = websiteName;
//     }
// }
// 
// Path: stickypunch-pushpackage/src/main/java/com/comandante/pushpackage/jackson/model/WebsiteBuilder.java
// public class WebsiteBuilder {
//     private String websiteName;
//     private String websitePushId;
//     private List<String> allowedDomains;
//     private String urlFormatString;
//     private String authenticationToken;
//     private String webServiceUrl;
// 
//     public WebsiteBuilder setWebsiteName(String websiteName) {
//         this.websiteName = websiteName;
//         return this;
//     }
// 
//     public WebsiteBuilder setWebsitePushId(String websitePushId) {
//         this.websitePushId = websitePushId;
//         return this;
//     }
// 
//     public WebsiteBuilder setAllowedDomains(List<String> allowedDomains) {
//         this.allowedDomains = allowedDomains;
//         return this;
//     }
// 
//     public WebsiteBuilder setUrlFormatString(String urlFormatString) {
//         this.urlFormatString = urlFormatString;
//         return this;
//     }
// 
//     public WebsiteBuilder setAuthenticationToken(String authenticationToken) {
//         this.authenticationToken = authenticationToken;
//         return this;
//     }
// 
//     public WebsiteBuilder setWebServiceUrl(String webServiceUrl) {
//         this.webServiceUrl = webServiceUrl;
//         return this;
//     }
// 
//     public Website build() {
//         return new Website(websiteName, websitePushId, allowedDomains, urlFormatString, authenticationToken, webServiceUrl);
//     }
// }


// Path: stickypunch-pushpackage/src/main/java/com/comandante/pushpackage/jackson/WebsiteDeserializer.java
import com.comandante.pushpackage.jackson.model.Website;
import com.comandante.pushpackage.jackson.model.WebsiteBuilder;
import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.ObjectCodec;
import org.codehaus.jackson.map.DeserializationContext;
import org.codehaus.jackson.map.JsonDeserializer;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

package com.comandante.pushpackage.jackson;



public class WebsiteDeserializer extends JsonDeserializer<Website> {

    public static final WebsiteDeserializer INSTANCE = new WebsiteDeserializer();

    @Override
    public Website deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
        ObjectCodec oc = jp.getCodec();
        JsonNode nodes = oc.readTree(jp);
        String websitePushID = nodes.get("websitePushID").getTextValue();
        String websiteName = nodes.get("websiteName").getTextValue();
        List<String> allowedDomains = new ArrayList<String>();
        for (JsonNode node : nodes.get("allowedDomains")) {
            allowedDomains.add(node.getTextValue());
        }
        String urlFormatString = nodes.get("urlFormatString").getTextValue();
        String authenticationToken = nodes.get("authenticationToken").getTextValue();
        String webServiceUrl = nodes.get("webServiceURL").getTextValue();

        return new WebsiteBuilder()
                .setWebsiteName(websiteName)
                .setWebsitePushId(websitePushID)
                .setAllowedDomains(allowedDomains)
                .setUrlFormatString(urlFormatString)
                .setAuthenticationToken(authenticationToken)