com.clinia.model.common.V1Operator Maven / Gradle / Ivy
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost
// - read more on https://github.com/clinia/api-clients-generation. DO NOT EDIT.
package com.clinia.model.common;
import com.clinia.exceptions.CliniaRuntimeException;
import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.core.*;
import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.databind.annotation.*;
import java.io.IOException;
import java.util.logging.Logger;
/** V1Operator */
@JsonDeserialize(using = V1Operator.Deserializer.class)
public interface V1Operator {
class Deserializer extends JsonDeserializer {
private static final Logger LOGGER = Logger.getLogger(Deserializer.class.getName());
@Override
public V1Operator deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException {
JsonNode tree = jp.readValueAsTree();
// deserialize V1AndOperator
if (tree.isObject()) {
try (JsonParser parser = tree.traverse(jp.getCodec())) {
return parser.readValueAs(V1AndOperator.class);
} catch (Exception e) {
// deserialization failed, continue
LOGGER.finest("Failed to deserialize oneOf V1AndOperator (error: " + e.getMessage() + ") (type: V1AndOperator)");
}
}
// deserialize V1OrOperator
if (tree.isObject()) {
try (JsonParser parser = tree.traverse(jp.getCodec())) {
return parser.readValueAs(V1OrOperator.class);
} catch (Exception e) {
// deserialization failed, continue
LOGGER.finest("Failed to deserialize oneOf V1OrOperator (error: " + e.getMessage() + ") (type: V1OrOperator)");
}
}
// deserialize V1AllOperator
if (tree.isObject()) {
try (JsonParser parser = tree.traverse(jp.getCodec())) {
return parser.readValueAs(V1AllOperator.class);
} catch (Exception e) {
// deserialization failed, continue
LOGGER.finest("Failed to deserialize oneOf V1AllOperator (error: " + e.getMessage() + ") (type: V1AllOperator)");
}
}
// deserialize V1AnyOperator
if (tree.isObject()) {
try (JsonParser parser = tree.traverse(jp.getCodec())) {
return parser.readValueAs(V1AnyOperator.class);
} catch (Exception e) {
// deserialization failed, continue
LOGGER.finest("Failed to deserialize oneOf V1AnyOperator (error: " + e.getMessage() + ") (type: V1AnyOperator)");
}
}
// deserialize V1CompositeOperator
if (tree.isObject()) {
try (JsonParser parser = tree.traverse(jp.getCodec())) {
return parser.readValueAs(V1CompositeOperator.class);
} catch (Exception e) {
// deserialization failed, continue
LOGGER.finest("Failed to deserialize oneOf V1CompositeOperator (error: " + e.getMessage() + ") (type: V1CompositeOperator)");
}
}
// deserialize V1EqOperator
if (tree.isObject()) {
try (JsonParser parser = tree.traverse(jp.getCodec())) {
return parser.readValueAs(V1EqOperator.class);
} catch (Exception e) {
// deserialization failed, continue
LOGGER.finest("Failed to deserialize oneOf V1EqOperator (error: " + e.getMessage() + ") (type: V1EqOperator)");
}
}
// deserialize V1GeoDistanceOperator
if (tree.isObject()) {
try (JsonParser parser = tree.traverse(jp.getCodec())) {
return parser.readValueAs(V1GeoDistanceOperator.class);
} catch (Exception e) {
// deserialization failed, continue
LOGGER.finest("Failed to deserialize oneOf V1GeoDistanceOperator (error: " + e.getMessage() + ") (type: V1GeoDistanceOperator)");
}
}
// deserialize V1GreaterThanOperator
if (tree.isObject()) {
try (JsonParser parser = tree.traverse(jp.getCodec())) {
return parser.readValueAs(V1GreaterThanOperator.class);
} catch (Exception e) {
// deserialization failed, continue
LOGGER.finest("Failed to deserialize oneOf V1GreaterThanOperator (error: " + e.getMessage() + ") (type: V1GreaterThanOperator)");
}
}
// deserialize V1LessThanOperator
if (tree.isObject()) {
try (JsonParser parser = tree.traverse(jp.getCodec())) {
return parser.readValueAs(V1LessThanOperator.class);
} catch (Exception e) {
// deserialization failed, continue
LOGGER.finest("Failed to deserialize oneOf V1LessThanOperator (error: " + e.getMessage() + ") (type: V1LessThanOperator)");
}
}
// deserialize V1NotOperator
if (tree.isObject()) {
try (JsonParser parser = tree.traverse(jp.getCodec())) {
return parser.readValueAs(V1NotOperator.class);
} catch (Exception e) {
// deserialization failed, continue
LOGGER.finest("Failed to deserialize oneOf V1NotOperator (error: " + e.getMessage() + ") (type: V1NotOperator)");
}
}
throw new CliniaRuntimeException(String.format("Failed to deserialize json element: %s", tree));
}
/** Handle deserialization of the 'null' value. */
@Override
public V1Operator getNullValue(DeserializationContext ctxt) throws JsonMappingException {
throw new JsonMappingException(ctxt.getParser(), "V1Operator cannot be null");
}
}
}