
package com.intellij.bcd.json;

import java.io.IOException;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;

@JsonDeserialize(using = VersionRemoved.MyDeserializer.class)
public class VersionRemoved {

    /**
     * Type: {@code String | Boolean}
     * 
     */
    private Object value;

    /**
     * Type: {@code String | Boolean}
     * 
     */
    public Object getValue() {
        return value;
    }

    /**
     * Type: {@code String | Boolean}
     * 
     */
    public void setValue(Object value) {
        this.value = value;
    }

    public static class MyDeserializer
        extends JsonDeserializer<VersionRemoved>
    {


        @Override
        public VersionRemoved deserialize(JsonParser parser, DeserializationContext deserializationContext)
            throws IOException
        {
            VersionRemoved result = new VersionRemoved();
            JsonToken token = parser.currentToken();
            if (token == JsonToken.VALUE_STRING) {
                result.value = parser.readValueAs(String.class);
            } else {
                if ((token == JsonToken.VALUE_TRUE)||(token == JsonToken.VALUE_FALSE)) {
                    result.value = parser.readValueAs(Boolean.class);
                } else {
                    deserializationContext.handleUnexpectedToken(Object.class, parser);
                }
            }
            return result;
        }

    }

}
