// Path: src/main/java/com/verifalia/api/emailvalidations/models/QualityLevelName.java
// public class QualityLevelName {
//     /**
//      * The Standard quality level. Suitable for most businesses, provides good results for the vast majority of email
//      * addresses; features a single validation pass and 5 second anti-tarpit time; less suitable for validating email
//      * addresses with temporary issues (mailbox over quota, greylisting, etc.) and slower mail exchangers.
//      */
//     public static QualityLevelName Standard = new QualityLevelName("Standard");
// 
//     /**
//      * The High quality level. Much higher quality, featuring 3 validation passes and 50 seconds of anti-tarpit time,
//      * so you can even validate most addresses with temporary issues, or slower mail exchangers.
//      */
//     public static QualityLevelName High = new QualityLevelName("High");
// 
//     /**
//      * The Extreme quality level. Unbeatable, top-notch quality for professionals who need the best results the industry
//      * can offer: performs email validations at the highest level, with 9 validation passes and 2 minutes of anti-tarpit
//      * time.
//      */
//     public static QualityLevelName Extreme = new QualityLevelName("Extreme");
// 
//     private final String nameOrGuid;
// 
//     /**
//      * Initializes a new instance of <tt>QualityLevelName</tt> from its name.
//      * @param nameOrGuid
//      */
//     public QualityLevelName(@NonNull final String nameOrGuid) {
//         this.nameOrGuid = nameOrGuid;
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
//         QualityLevelName that = (QualityLevelName) o;
//         return nameOrGuid.equals(that.nameOrGuid);
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(nameOrGuid);
//     }
// 
//     @Override
//     public String toString() {
//         return nameOrGuid;
//     }
// }
// 
// Path: src/main/java/com/verifalia/api/emailvalidations/models/ValidationPriority.java
// @Getter
// public class ValidationPriority {
//     private byte value;
// 
//     /**
//      * The lowest possible processing priority (speed) for a validation job.
//      */
//     public static ValidationPriority Lowest = new ValidationPriority((byte) 0);
// 
//     /**
//      * Normal processing priority (speed) for a validation job.
//      */
//     public static ValidationPriority Normal = new ValidationPriority((byte) 127);
// 
//     /**
//      * The highest possible processing priority (speed) for a validation job.
//      */
//     public static ValidationPriority Highest = new ValidationPriority((byte) 255);
// 
//     /**
//      * Initializes a custom processing priority using the given specified value.
//      * @param value The allowed range of values spans from {@link #Lowest} (0 - lowest priority) to {@link #Highest}
//      * (255 - highest priority), where the midway value {@link #Normal} (127) means normal priority.
//      */
//     public ValidationPriority(byte value) {
//         this.value = value;
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
//         ValidationPriority that = (ValidationPriority) o;
//         return value == that.value;
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(value);
//     }
// 
//     @Override
//     public String toString() {
//         if (this.value == Lowest.value)
//         {
//             return new Byte(this.value).toString() + " (lowest)";
//         }
// 
//         if (this.value == Normal.value)
//         {
//             return new Byte(this.value).toString() + " (normal)";
//         }
// 
//         if (this.value == Highest.value)
//         {
//             return new Byte(this.value).toString() + " (highest)";
//         }
// 
//         return new Byte(this.value).toString();
//     }
// }


import com.verifalia.api.emailvalidations.models.QualityLevelName;
import com.verifalia.api.emailvalidations.models.ValidationPriority;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.DeserializationContext;
import org.codehaus.jackson.map.JsonDeserializer;
import java.io.IOException;
/*
 * Verifalia - Email list cleaning and real-time email verification service
 * https://verifalia.com/
 * support@verifalia.com
 *
 * Copyright (c) 2005-2020 Cobisi Research
 *
 * Cobisi Research
 * Via Prima Strada, 35
 * 35129, Padova
 * Italy - European Union
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

package com.verifalia.api.emailvalidations.serialization;



/**
 * A Json deserializer for validation priorities returned by the Verifalia API.
 */
public class ValidationPriorityDeserializer extends JsonDeserializer<ValidationPriority> {
    @Override
    public ValidationPriority deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
        String value = jp.getText();

        if (value == null) {
            return null;
        }

// Path: src/main/java/com/verifalia/api/emailvalidations/models/QualityLevelName.java
// public class QualityLevelName {
//     /**
//      * The Standard quality level. Suitable for most businesses, provides good results for the vast majority of email
//      * addresses; features a single validation pass and 5 second anti-tarpit time; less suitable for validating email
//      * addresses with temporary issues (mailbox over quota, greylisting, etc.) and slower mail exchangers.
//      */
//     public static QualityLevelName Standard = new QualityLevelName("Standard");
// 
//     /**
//      * The High quality level. Much higher quality, featuring 3 validation passes and 50 seconds of anti-tarpit time,
//      * so you can even validate most addresses with temporary issues, or slower mail exchangers.
//      */
//     public static QualityLevelName High = new QualityLevelName("High");
// 
//     /**
//      * The Extreme quality level. Unbeatable, top-notch quality for professionals who need the best results the industry
//      * can offer: performs email validations at the highest level, with 9 validation passes and 2 minutes of anti-tarpit
//      * time.
//      */
//     public static QualityLevelName Extreme = new QualityLevelName("Extreme");
// 
//     private final String nameOrGuid;
// 
//     /**
//      * Initializes a new instance of <tt>QualityLevelName</tt> from its name.
//      * @param nameOrGuid
//      */
//     public QualityLevelName(@NonNull final String nameOrGuid) {
//         this.nameOrGuid = nameOrGuid;
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
//         QualityLevelName that = (QualityLevelName) o;
//         return nameOrGuid.equals(that.nameOrGuid);
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(nameOrGuid);
//     }
// 
//     @Override
//     public String toString() {
//         return nameOrGuid;
//     }
// }
// 
// Path: src/main/java/com/verifalia/api/emailvalidations/models/ValidationPriority.java
// @Getter
// public class ValidationPriority {
//     private byte value;
// 
//     /**
//      * The lowest possible processing priority (speed) for a validation job.
//      */
//     public static ValidationPriority Lowest = new ValidationPriority((byte) 0);
// 
//     /**
//      * Normal processing priority (speed) for a validation job.
//      */
//     public static ValidationPriority Normal = new ValidationPriority((byte) 127);
// 
//     /**
//      * The highest possible processing priority (speed) for a validation job.
//      */
//     public static ValidationPriority Highest = new ValidationPriority((byte) 255);
// 
//     /**
//      * Initializes a custom processing priority using the given specified value.
//      * @param value The allowed range of values spans from {@link #Lowest} (0 - lowest priority) to {@link #Highest}
//      * (255 - highest priority), where the midway value {@link #Normal} (127) means normal priority.
//      */
//     public ValidationPriority(byte value) {
//         this.value = value;
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
//         ValidationPriority that = (ValidationPriority) o;
//         return value == that.value;
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(value);
//     }
// 
//     @Override
//     public String toString() {
//         if (this.value == Lowest.value)
//         {
//             return new Byte(this.value).toString() + " (lowest)";
//         }
// 
//         if (this.value == Normal.value)
//         {
//             return new Byte(this.value).toString() + " (normal)";
//         }
// 
//         if (this.value == Highest.value)
//         {
//             return new Byte(this.value).toString() + " (highest)";
//         }
// 
//         return new Byte(this.value).toString();
//     }
// }


// Path: src/main/java/com/verifalia/api/emailvalidations/serialization/ValidationPriorityDeserializer.java
import com.verifalia.api.emailvalidations.models.QualityLevelName;
import com.verifalia.api.emailvalidations.models.ValidationPriority;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.DeserializationContext;
import org.codehaus.jackson.map.JsonDeserializer;
import java.io.IOException;

/*
 * Verifalia - Email list cleaning and real-time email verification service
 * https://verifalia.com/
 * support@verifalia.com
 *
 * Copyright (c) 2005-2020 Cobisi Research
 *
 * Cobisi Research
 * Via Prima Strada, 35
 * 35129, Padova
 * Italy - European Union
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

package com.verifalia.api.emailvalidations.serialization;



/**
 * A Json deserializer for validation priorities returned by the Verifalia API.
 */
public class ValidationPriorityDeserializer extends JsonDeserializer<ValidationPriority> {
    @Override
    public ValidationPriority deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
        String value = jp.getText();

        if (value == null) {
            return null;
        }

        return new ValidationPriority(Byte.parseByte(value));