All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.clinia.model.common.V1PropertyDefinition 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;

/** V1PropertyDefinition */
@JsonDeserialize(using = V1PropertyDefinition.Deserializer.class)
public interface V1PropertyDefinition {
  class Deserializer extends JsonDeserializer {

    private static final Logger LOGGER = Logger.getLogger(Deserializer.class.getName());

    @Override
    public V1PropertyDefinition deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException {
      JsonNode tree = jp.readValueAsTree();
      // deserialize V1AddressPropertyDefinition
      if (tree.isObject()) {
        try (JsonParser parser = tree.traverse(jp.getCodec())) {
          return parser.readValueAs(V1AddressPropertyDefinition.class);
        } catch (Exception e) {
          // deserialization failed, continue
          LOGGER.finest(
            "Failed to deserialize oneOf V1AddressPropertyDefinition (error: " + e.getMessage() + ") (type: V1AddressPropertyDefinition)"
          );
        }
      }
      // deserialize V1ArrayPropertyDefinition
      if (tree.isObject()) {
        try (JsonParser parser = tree.traverse(jp.getCodec())) {
          return parser.readValueAs(V1ArrayPropertyDefinition.class);
        } catch (Exception e) {
          // deserialization failed, continue
          LOGGER.finest(
            "Failed to deserialize oneOf V1ArrayPropertyDefinition (error: " + e.getMessage() + ") (type: V1ArrayPropertyDefinition)"
          );
        }
      }
      // deserialize V1AttachmentPropertyDefinition
      if (tree.isObject()) {
        try (JsonParser parser = tree.traverse(jp.getCodec())) {
          return parser.readValueAs(V1AttachmentPropertyDefinition.class);
        } catch (Exception e) {
          // deserialization failed, continue
          LOGGER.finest(
            "Failed to deserialize oneOf V1AttachmentPropertyDefinition (error: " +
            e.getMessage() +
            ") (type: V1AttachmentPropertyDefinition)"
          );
        }
      }
      // deserialize V1BooleanPropertyDefinition
      if (tree.isObject()) {
        try (JsonParser parser = tree.traverse(jp.getCodec())) {
          return parser.readValueAs(V1BooleanPropertyDefinition.class);
        } catch (Exception e) {
          // deserialization failed, continue
          LOGGER.finest(
            "Failed to deserialize oneOf V1BooleanPropertyDefinition (error: " + e.getMessage() + ") (type: V1BooleanPropertyDefinition)"
          );
        }
      }
      // deserialize V1CodePropertyDefinition
      if (tree.isObject()) {
        try (JsonParser parser = tree.traverse(jp.getCodec())) {
          return parser.readValueAs(V1CodePropertyDefinition.class);
        } catch (Exception e) {
          // deserialization failed, continue
          LOGGER.finest(
            "Failed to deserialize oneOf V1CodePropertyDefinition (error: " + e.getMessage() + ") (type: V1CodePropertyDefinition)"
          );
        }
      }
      // deserialize V1CodingPropertyDefinition
      if (tree.isObject()) {
        try (JsonParser parser = tree.traverse(jp.getCodec())) {
          return parser.readValueAs(V1CodingPropertyDefinition.class);
        } catch (Exception e) {
          // deserialization failed, continue
          LOGGER.finest(
            "Failed to deserialize oneOf V1CodingPropertyDefinition (error: " + e.getMessage() + ") (type: V1CodingPropertyDefinition)"
          );
        }
      }
      // deserialize V1ContactDetailPropertyDefinition
      if (tree.isObject()) {
        try (JsonParser parser = tree.traverse(jp.getCodec())) {
          return parser.readValueAs(V1ContactDetailPropertyDefinition.class);
        } catch (Exception e) {
          // deserialization failed, continue
          LOGGER.finest(
            "Failed to deserialize oneOf V1ContactDetailPropertyDefinition (error: " +
            e.getMessage() +
            ") (type: V1ContactDetailPropertyDefinition)"
          );
        }
      }
      // deserialize V1ContactPointPropertyDefinition
      if (tree.isObject()) {
        try (JsonParser parser = tree.traverse(jp.getCodec())) {
          return parser.readValueAs(V1ContactPointPropertyDefinition.class);
        } catch (Exception e) {
          // deserialization failed, continue
          LOGGER.finest(
            "Failed to deserialize oneOf V1ContactPointPropertyDefinition (error: " +
            e.getMessage() +
            ") (type: V1ContactPointPropertyDefinition)"
          );
        }
      }
      // deserialize V1DatePropertyDefinition
      if (tree.isObject()) {
        try (JsonParser parser = tree.traverse(jp.getCodec())) {
          return parser.readValueAs(V1DatePropertyDefinition.class);
        } catch (Exception e) {
          // deserialization failed, continue
          LOGGER.finest(
            "Failed to deserialize oneOf V1DatePropertyDefinition (error: " + e.getMessage() + ") (type: V1DatePropertyDefinition)"
          );
        }
      }
      // deserialize V1DateTimePropertyDefinition
      if (tree.isObject()) {
        try (JsonParser parser = tree.traverse(jp.getCodec())) {
          return parser.readValueAs(V1DateTimePropertyDefinition.class);
        } catch (Exception e) {
          // deserialization failed, continue
          LOGGER.finest(
            "Failed to deserialize oneOf V1DateTimePropertyDefinition (error: " + e.getMessage() + ") (type: V1DateTimePropertyDefinition)"
          );
        }
      }
      // deserialize V1DecimalPropertyDefinition
      if (tree.isObject()) {
        try (JsonParser parser = tree.traverse(jp.getCodec())) {
          return parser.readValueAs(V1DecimalPropertyDefinition.class);
        } catch (Exception e) {
          // deserialization failed, continue
          LOGGER.finest(
            "Failed to deserialize oneOf V1DecimalPropertyDefinition (error: " + e.getMessage() + ") (type: V1DecimalPropertyDefinition)"
          );
        }
      }
      // deserialize V1GeoPointPropertyDefinition
      if (tree.isObject()) {
        try (JsonParser parser = tree.traverse(jp.getCodec())) {
          return parser.readValueAs(V1GeoPointPropertyDefinition.class);
        } catch (Exception e) {
          // deserialization failed, continue
          LOGGER.finest(
            "Failed to deserialize oneOf V1GeoPointPropertyDefinition (error: " + e.getMessage() + ") (type: V1GeoPointPropertyDefinition)"
          );
        }
      }
      // deserialize V1HumanNamePropertyDefinition
      if (tree.isObject()) {
        try (JsonParser parser = tree.traverse(jp.getCodec())) {
          return parser.readValueAs(V1HumanNamePropertyDefinition.class);
        } catch (Exception e) {
          // deserialization failed, continue
          LOGGER.finest(
            "Failed to deserialize oneOf V1HumanNamePropertyDefinition (error: " +
            e.getMessage() +
            ") (type: V1HumanNamePropertyDefinition)"
          );
        }
      }
      // deserialize V1IdentifierPropertyDefinition
      if (tree.isObject()) {
        try (JsonParser parser = tree.traverse(jp.getCodec())) {
          return parser.readValueAs(V1IdentifierPropertyDefinition.class);
        } catch (Exception e) {
          // deserialization failed, continue
          LOGGER.finest(
            "Failed to deserialize oneOf V1IdentifierPropertyDefinition (error: " +
            e.getMessage() +
            ") (type: V1IdentifierPropertyDefinition)"
          );
        }
      }
      // deserialize V1InstantPropertyDefinition
      if (tree.isObject()) {
        try (JsonParser parser = tree.traverse(jp.getCodec())) {
          return parser.readValueAs(V1InstantPropertyDefinition.class);
        } catch (Exception e) {
          // deserialization failed, continue
          LOGGER.finest(
            "Failed to deserialize oneOf V1InstantPropertyDefinition (error: " + e.getMessage() + ") (type: V1InstantPropertyDefinition)"
          );
        }
      }
      // deserialize V1IntegerPropertyDefinition
      if (tree.isObject()) {
        try (JsonParser parser = tree.traverse(jp.getCodec())) {
          return parser.readValueAs(V1IntegerPropertyDefinition.class);
        } catch (Exception e) {
          // deserialization failed, continue
          LOGGER.finest(
            "Failed to deserialize oneOf V1IntegerPropertyDefinition (error: " + e.getMessage() + ") (type: V1IntegerPropertyDefinition)"
          );
        }
      }
      // deserialize V1MarkdownPropertyDefinition
      if (tree.isObject()) {
        try (JsonParser parser = tree.traverse(jp.getCodec())) {
          return parser.readValueAs(V1MarkdownPropertyDefinition.class);
        } catch (Exception e) {
          // deserialization failed, continue
          LOGGER.finest(
            "Failed to deserialize oneOf V1MarkdownPropertyDefinition (error: " + e.getMessage() + ") (type: V1MarkdownPropertyDefinition)"
          );
        }
      }
      // deserialize V1ObjectPropertyDefinition
      if (tree.isObject()) {
        try (JsonParser parser = tree.traverse(jp.getCodec())) {
          return parser.readValueAs(V1ObjectPropertyDefinition.class);
        } catch (Exception e) {
          // deserialization failed, continue
          LOGGER.finest(
            "Failed to deserialize oneOf V1ObjectPropertyDefinition (error: " + e.getMessage() + ") (type: V1ObjectPropertyDefinition)"
          );
        }
      }
      // deserialize V1PeriodPropertyDefinition
      if (tree.isObject()) {
        try (JsonParser parser = tree.traverse(jp.getCodec())) {
          return parser.readValueAs(V1PeriodPropertyDefinition.class);
        } catch (Exception e) {
          // deserialization failed, continue
          LOGGER.finest(
            "Failed to deserialize oneOf V1PeriodPropertyDefinition (error: " + e.getMessage() + ") (type: V1PeriodPropertyDefinition)"
          );
        }
      }
      // deserialize V1ReferencePropertyDefinition
      if (tree.isObject()) {
        try (JsonParser parser = tree.traverse(jp.getCodec())) {
          return parser.readValueAs(V1ReferencePropertyDefinition.class);
        } catch (Exception e) {
          // deserialization failed, continue
          LOGGER.finest(
            "Failed to deserialize oneOf V1ReferencePropertyDefinition (error: " +
            e.getMessage() +
            ") (type: V1ReferencePropertyDefinition)"
          );
        }
      }
      // deserialize V1SymbolPropertyDefinition
      if (tree.isObject()) {
        try (JsonParser parser = tree.traverse(jp.getCodec())) {
          return parser.readValueAs(V1SymbolPropertyDefinition.class);
        } catch (Exception e) {
          // deserialization failed, continue
          LOGGER.finest(
            "Failed to deserialize oneOf V1SymbolPropertyDefinition (error: " + e.getMessage() + ") (type: V1SymbolPropertyDefinition)"
          );
        }
      }
      // deserialize V1TimePropertyDefinition
      if (tree.isObject()) {
        try (JsonParser parser = tree.traverse(jp.getCodec())) {
          return parser.readValueAs(V1TimePropertyDefinition.class);
        } catch (Exception e) {
          // deserialization failed, continue
          LOGGER.finest(
            "Failed to deserialize oneOf V1TimePropertyDefinition (error: " + e.getMessage() + ") (type: V1TimePropertyDefinition)"
          );
        }
      }
      // deserialize V1UriPropertyDefinition
      if (tree.isObject()) {
        try (JsonParser parser = tree.traverse(jp.getCodec())) {
          return parser.readValueAs(V1UriPropertyDefinition.class);
        } catch (Exception e) {
          // deserialization failed, continue
          LOGGER.finest(
            "Failed to deserialize oneOf V1UriPropertyDefinition (error: " + e.getMessage() + ") (type: V1UriPropertyDefinition)"
          );
        }
      }
      // deserialize V1UrlPropertyDefinition
      if (tree.isObject()) {
        try (JsonParser parser = tree.traverse(jp.getCodec())) {
          return parser.readValueAs(V1UrlPropertyDefinition.class);
        } catch (Exception e) {
          // deserialization failed, continue
          LOGGER.finest(
            "Failed to deserialize oneOf V1UrlPropertyDefinition (error: " + e.getMessage() + ") (type: V1UrlPropertyDefinition)"
          );
        }
      }
      // deserialize V1XhtmlPropertyDefinition
      if (tree.isObject()) {
        try (JsonParser parser = tree.traverse(jp.getCodec())) {
          return parser.readValueAs(V1XhtmlPropertyDefinition.class);
        } catch (Exception e) {
          // deserialization failed, continue
          LOGGER.finest(
            "Failed to deserialize oneOf V1XhtmlPropertyDefinition (error: " + e.getMessage() + ") (type: V1XhtmlPropertyDefinition)"
          );
        }
      }
      throw new CliniaRuntimeException(String.format("Failed to deserialize json element: %s", tree));
    }

    /** Handle deserialization of the 'null' value. */
    @Override
    public V1PropertyDefinition getNullValue(DeserializationContext ctxt) throws JsonMappingException {
      throw new JsonMappingException(ctxt.getParser(), "V1PropertyDefinition cannot be null");
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy