Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* FactSet Estimates Report Builder
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.factset.sdk.FactSetEstimatesReportBuilder.models;
import java.util.Objects;
import java.util.Arrays;
import java.util.Map;
import java.util.HashMap;
import com.factset.sdk.FactSetEstimatesReportBuilder.models.Category;
import com.factset.sdk.FactSetEstimatesReportBuilder.models.CategoryCategory;
import com.factset.sdk.FactSetEstimatesReportBuilder.models.CurrencyCode;
import com.factset.sdk.FactSetEstimatesReportBuilder.models.CurrencyCodeCurrencyCode;
import com.factset.sdk.FactSetEstimatesReportBuilder.models.CurrencySymbol;
import com.factset.sdk.FactSetEstimatesReportBuilder.models.CurrencySymbolCurrencySymbol;
import com.factset.sdk.FactSetEstimatesReportBuilder.models.Description;
import com.factset.sdk.FactSetEstimatesReportBuilder.models.DescriptionDescription;
import com.factset.sdk.FactSetEstimatesReportBuilder.models.Frequency;
import com.factset.sdk.FactSetEstimatesReportBuilder.models.FrequencyFrequency;
import com.factset.sdk.FactSetEstimatesReportBuilder.models.MetricEstimates;
import com.factset.sdk.FactSetEstimatesReportBuilder.models.MetricEstimatesMetricEstimates;
import com.factset.sdk.FactSetEstimatesReportBuilder.models.Scale;
import com.factset.sdk.FactSetEstimatesReportBuilder.models.ScaleScale;
import com.factset.sdk.FactSetEstimatesReportBuilder.models.ValueType;
import com.factset.sdk.FactSetEstimatesReportBuilder.models.ValueTypeValueType;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.factset.sdk.FactSetEstimatesReportBuilder.JSON;
import com.fasterxml.jackson.core.type.TypeReference;
import jakarta.ws.rs.core.GenericType;
import jakarta.ws.rs.core.Response;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.math.BigDecimal;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.JsonToken;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import com.factset.sdk.FactSetEstimatesReportBuilder.JSON;
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
@JsonDeserialize(using = MetadataEntry.MetadataEntryDeserializer.class)
@JsonSerialize(using = MetadataEntry.MetadataEntrySerializer.class)
public class MetadataEntry extends AbstractOpenApiSchema implements Serializable {
private static final Logger log = Logger.getLogger(MetadataEntry.class.getName());
public static class MetadataEntrySerializer extends StdSerializer {
public MetadataEntrySerializer(Class t) {
super(t);
}
public MetadataEntrySerializer() {
this(null);
}
@Override
public void serialize(MetadataEntry value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException {
jgen.writeObject(value.getActualInstance());
}
}
public static class MetadataEntryDeserializer extends StdDeserializer {
public MetadataEntryDeserializer() {
this(MetadataEntry.class);
}
public MetadataEntryDeserializer(Class> vc) {
super(vc);
}
@Override
public MetadataEntry deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
JsonNode tree = jp.readValueAsTree();
Object deserialized = null;
boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS);
int match = 0;
JsonToken token = tree.traverse(jp.getCodec()).nextToken();
// deserialize CurrencyCode
try {
boolean attemptParsing = true;
// ensure that we respect type coercion as set on the client ObjectMapper
if (CurrencyCode.class.equals(Integer.class) || CurrencyCode.class.equals(Long.class) || CurrencyCode.class.equals(Float.class) || CurrencyCode.class.equals(Double.class) || CurrencyCode.class.equals(Boolean.class) || CurrencyCode.class.equals(String.class)) {
attemptParsing = typeCoercion;
if (!attemptParsing) {
attemptParsing |= ((CurrencyCode.class.equals(Integer.class) || CurrencyCode.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT);
attemptParsing |= ((CurrencyCode.class.equals(Float.class) || CurrencyCode.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT);
attemptParsing |= (CurrencyCode.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
attemptParsing |= (CurrencyCode.class.equals(String.class) && token == JsonToken.VALUE_STRING);
}
}
if (attemptParsing) {
deserialized = tree.traverse(jp.getCodec()).readValueAs(new TypeReference() { });
// TODO: there is no validation against JSON schema constraints
// (min, max, enum, pattern...), this does not perform a strict JSON
// validation, which means the 'match' count may be higher than it should be.
match++;
log.log(Level.FINER, "Input data matches schema 'CurrencyCode'");
}
} catch (Exception e) {
// deserialization failed, continue
log.log(Level.FINER, "Input data does not match schema 'CurrencyCode'", e);
}
// deserialize CurrencySymbol
try {
boolean attemptParsing = true;
// ensure that we respect type coercion as set on the client ObjectMapper
if (CurrencySymbol.class.equals(Integer.class) || CurrencySymbol.class.equals(Long.class) || CurrencySymbol.class.equals(Float.class) || CurrencySymbol.class.equals(Double.class) || CurrencySymbol.class.equals(Boolean.class) || CurrencySymbol.class.equals(String.class)) {
attemptParsing = typeCoercion;
if (!attemptParsing) {
attemptParsing |= ((CurrencySymbol.class.equals(Integer.class) || CurrencySymbol.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT);
attemptParsing |= ((CurrencySymbol.class.equals(Float.class) || CurrencySymbol.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT);
attemptParsing |= (CurrencySymbol.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
attemptParsing |= (CurrencySymbol.class.equals(String.class) && token == JsonToken.VALUE_STRING);
}
}
if (attemptParsing) {
deserialized = tree.traverse(jp.getCodec()).readValueAs(new TypeReference() { });
// TODO: there is no validation against JSON schema constraints
// (min, max, enum, pattern...), this does not perform a strict JSON
// validation, which means the 'match' count may be higher than it should be.
match++;
log.log(Level.FINER, "Input data matches schema 'CurrencySymbol'");
}
} catch (Exception e) {
// deserialization failed, continue
log.log(Level.FINER, "Input data does not match schema 'CurrencySymbol'", e);
}
// deserialize Category
try {
boolean attemptParsing = true;
// ensure that we respect type coercion as set on the client ObjectMapper
if (Category.class.equals(Integer.class) || Category.class.equals(Long.class) || Category.class.equals(Float.class) || Category.class.equals(Double.class) || Category.class.equals(Boolean.class) || Category.class.equals(String.class)) {
attemptParsing = typeCoercion;
if (!attemptParsing) {
attemptParsing |= ((Category.class.equals(Integer.class) || Category.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT);
attemptParsing |= ((Category.class.equals(Float.class) || Category.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT);
attemptParsing |= (Category.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
attemptParsing |= (Category.class.equals(String.class) && token == JsonToken.VALUE_STRING);
}
}
if (attemptParsing) {
deserialized = tree.traverse(jp.getCodec()).readValueAs(new TypeReference() { });
// TODO: there is no validation against JSON schema constraints
// (min, max, enum, pattern...), this does not perform a strict JSON
// validation, which means the 'match' count may be higher than it should be.
match++;
log.log(Level.FINER, "Input data matches schema 'Category'");
}
} catch (Exception e) {
// deserialization failed, continue
log.log(Level.FINER, "Input data does not match schema 'Category'", e);
}
// deserialize MetricEstimates
try {
boolean attemptParsing = true;
// ensure that we respect type coercion as set on the client ObjectMapper
if (MetricEstimates.class.equals(Integer.class) || MetricEstimates.class.equals(Long.class) || MetricEstimates.class.equals(Float.class) || MetricEstimates.class.equals(Double.class) || MetricEstimates.class.equals(Boolean.class) || MetricEstimates.class.equals(String.class)) {
attemptParsing = typeCoercion;
if (!attemptParsing) {
attemptParsing |= ((MetricEstimates.class.equals(Integer.class) || MetricEstimates.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT);
attemptParsing |= ((MetricEstimates.class.equals(Float.class) || MetricEstimates.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT);
attemptParsing |= (MetricEstimates.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
attemptParsing |= (MetricEstimates.class.equals(String.class) && token == JsonToken.VALUE_STRING);
}
}
if (attemptParsing) {
deserialized = tree.traverse(jp.getCodec()).readValueAs(new TypeReference() { });
// TODO: there is no validation against JSON schema constraints
// (min, max, enum, pattern...), this does not perform a strict JSON
// validation, which means the 'match' count may be higher than it should be.
match++;
log.log(Level.FINER, "Input data matches schema 'MetricEstimates'");
}
} catch (Exception e) {
// deserialization failed, continue
log.log(Level.FINER, "Input data does not match schema 'MetricEstimates'", e);
}
// deserialize ValueType
try {
boolean attemptParsing = true;
// ensure that we respect type coercion as set on the client ObjectMapper
if (ValueType.class.equals(Integer.class) || ValueType.class.equals(Long.class) || ValueType.class.equals(Float.class) || ValueType.class.equals(Double.class) || ValueType.class.equals(Boolean.class) || ValueType.class.equals(String.class)) {
attemptParsing = typeCoercion;
if (!attemptParsing) {
attemptParsing |= ((ValueType.class.equals(Integer.class) || ValueType.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT);
attemptParsing |= ((ValueType.class.equals(Float.class) || ValueType.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT);
attemptParsing |= (ValueType.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
attemptParsing |= (ValueType.class.equals(String.class) && token == JsonToken.VALUE_STRING);
}
}
if (attemptParsing) {
deserialized = tree.traverse(jp.getCodec()).readValueAs(new TypeReference() { });
// TODO: there is no validation against JSON schema constraints
// (min, max, enum, pattern...), this does not perform a strict JSON
// validation, which means the 'match' count may be higher than it should be.
match++;
log.log(Level.FINER, "Input data matches schema 'ValueType'");
}
} catch (Exception e) {
// deserialization failed, continue
log.log(Level.FINER, "Input data does not match schema 'ValueType'", e);
}
// deserialize Scale
try {
boolean attemptParsing = true;
// ensure that we respect type coercion as set on the client ObjectMapper
if (Scale.class.equals(Integer.class) || Scale.class.equals(Long.class) || Scale.class.equals(Float.class) || Scale.class.equals(Double.class) || Scale.class.equals(Boolean.class) || Scale.class.equals(String.class)) {
attemptParsing = typeCoercion;
if (!attemptParsing) {
attemptParsing |= ((Scale.class.equals(Integer.class) || Scale.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT);
attemptParsing |= ((Scale.class.equals(Float.class) || Scale.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT);
attemptParsing |= (Scale.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
attemptParsing |= (Scale.class.equals(String.class) && token == JsonToken.VALUE_STRING);
}
}
if (attemptParsing) {
deserialized = tree.traverse(jp.getCodec()).readValueAs(new TypeReference() { });
// TODO: there is no validation against JSON schema constraints
// (min, max, enum, pattern...), this does not perform a strict JSON
// validation, which means the 'match' count may be higher than it should be.
match++;
log.log(Level.FINER, "Input data matches schema 'Scale'");
}
} catch (Exception e) {
// deserialization failed, continue
log.log(Level.FINER, "Input data does not match schema 'Scale'", e);
}
// deserialize Description
try {
boolean attemptParsing = true;
// ensure that we respect type coercion as set on the client ObjectMapper
if (Description.class.equals(Integer.class) || Description.class.equals(Long.class) || Description.class.equals(Float.class) || Description.class.equals(Double.class) || Description.class.equals(Boolean.class) || Description.class.equals(String.class)) {
attemptParsing = typeCoercion;
if (!attemptParsing) {
attemptParsing |= ((Description.class.equals(Integer.class) || Description.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT);
attemptParsing |= ((Description.class.equals(Float.class) || Description.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT);
attemptParsing |= (Description.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
attemptParsing |= (Description.class.equals(String.class) && token == JsonToken.VALUE_STRING);
}
}
if (attemptParsing) {
deserialized = tree.traverse(jp.getCodec()).readValueAs(new TypeReference() { });
// TODO: there is no validation against JSON schema constraints
// (min, max, enum, pattern...), this does not perform a strict JSON
// validation, which means the 'match' count may be higher than it should be.
match++;
log.log(Level.FINER, "Input data matches schema 'Description'");
}
} catch (Exception e) {
// deserialization failed, continue
log.log(Level.FINER, "Input data does not match schema 'Description'", e);
}
// deserialize Frequency
try {
boolean attemptParsing = true;
// ensure that we respect type coercion as set on the client ObjectMapper
if (Frequency.class.equals(Integer.class) || Frequency.class.equals(Long.class) || Frequency.class.equals(Float.class) || Frequency.class.equals(Double.class) || Frequency.class.equals(Boolean.class) || Frequency.class.equals(String.class)) {
attemptParsing = typeCoercion;
if (!attemptParsing) {
attemptParsing |= ((Frequency.class.equals(Integer.class) || Frequency.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT);
attemptParsing |= ((Frequency.class.equals(Float.class) || Frequency.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT);
attemptParsing |= (Frequency.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
attemptParsing |= (Frequency.class.equals(String.class) && token == JsonToken.VALUE_STRING);
}
}
if (attemptParsing) {
deserialized = tree.traverse(jp.getCodec()).readValueAs(new TypeReference() { });
// TODO: there is no validation against JSON schema constraints
// (min, max, enum, pattern...), this does not perform a strict JSON
// validation, which means the 'match' count may be higher than it should be.
match++;
log.log(Level.FINER, "Input data matches schema 'Frequency'");
}
} catch (Exception e) {
// deserialization failed, continue
log.log(Level.FINER, "Input data does not match schema 'Frequency'", e);
}
if (match == 1) {
MetadataEntry ret = new MetadataEntry();
ret.setActualInstance(deserialized);
return ret;
}
throw new IOException(String.format("Failed deserialization for MetadataEntry: %d classes match result, expected 1", match));
}
/**
* Handle deserialization of the 'null' value.
*/
@Override
public MetadataEntry getNullValue(DeserializationContext ctxt) throws JsonMappingException {
throw new JsonMappingException(ctxt.getParser(), "MetadataEntry cannot be null");
}
}
// store a list of schema names defined in oneOf
public static final Map schemas = new HashMap();
public MetadataEntry() {
super("oneOf", Boolean.FALSE);
}
public MetadataEntry(CurrencyCode o) {
super("oneOf", Boolean.FALSE);
setActualInstance(o);
}
public MetadataEntry(CurrencySymbol o) {
super("oneOf", Boolean.FALSE);
setActualInstance(o);
}
public MetadataEntry(Category o) {
super("oneOf", Boolean.FALSE);
setActualInstance(o);
}
public MetadataEntry(MetricEstimates o) {
super("oneOf", Boolean.FALSE);
setActualInstance(o);
}
public MetadataEntry(ValueType o) {
super("oneOf", Boolean.FALSE);
setActualInstance(o);
}
public MetadataEntry(Scale o) {
super("oneOf", Boolean.FALSE);
setActualInstance(o);
}
public MetadataEntry(Description o) {
super("oneOf", Boolean.FALSE);
setActualInstance(o);
}
public MetadataEntry(Frequency o) {
super("oneOf", Boolean.FALSE);
setActualInstance(o);
}
static {
schemas.put("Category", new GenericType() {
});
schemas.put("CurrencyCode", new GenericType() {
});
schemas.put("CurrencySymbol", new GenericType() {
});
schemas.put("Description", new GenericType() {
});
schemas.put("Frequency", new GenericType() {
});
schemas.put("MetricEstimates", new GenericType() {
});
schemas.put("Scale", new GenericType() {
});
schemas.put("ValueType", new GenericType() {
});
JSON.registerDescendants(MetadataEntry.class, Collections.unmodifiableMap(schemas));
}
@Override
public Map getSchemas() {
return MetadataEntry.schemas;
}
/**
* Set the instance that matches the oneOf child schema, check
* the instance parameter is valid against the oneOf child schemas:
* Category, CurrencyCode, CurrencySymbol, Description, Frequency, MetricEstimates, Scale, ValueType
*
* It could be an instance of the 'oneOf' schemas.
* The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf).
*/
@Override
public void setActualInstance(Object instance) {
// CurrencyCode
if (JSON.isInstanceOf(CurrencyCode.class, instance, new HashSet>())) {
super.setActualInstance(instance);
return;
}
// CurrencySymbol
if (JSON.isInstanceOf(CurrencySymbol.class, instance, new HashSet>())) {
super.setActualInstance(instance);
return;
}
// Category
if (JSON.isInstanceOf(Category.class, instance, new HashSet>())) {
super.setActualInstance(instance);
return;
}
// MetricEstimates
if (JSON.isInstanceOf(MetricEstimates.class, instance, new HashSet>())) {
super.setActualInstance(instance);
return;
}
// ValueType
if (JSON.isInstanceOf(ValueType.class, instance, new HashSet>())) {
super.setActualInstance(instance);
return;
}
// Scale
if (JSON.isInstanceOf(Scale.class, instance, new HashSet>())) {
super.setActualInstance(instance);
return;
}
// Description
if (JSON.isInstanceOf(Description.class, instance, new HashSet>())) {
super.setActualInstance(instance);
return;
}
// Frequency
if (JSON.isInstanceOf(Frequency.class, instance, new HashSet>())) {
super.setActualInstance(instance);
return;
}
throw new RuntimeException("Invalid instance type. Must be Category, CurrencyCode, CurrencySymbol, Description, Frequency, MetricEstimates, Scale, ValueType");
}
/**
* Get the actual instance, which can be the following:
* Category, CurrencyCode, CurrencySymbol, Description, Frequency, MetricEstimates, Scale, ValueType
*
* @return The actual instance (Category, CurrencyCode, CurrencySymbol, Description, Frequency, MetricEstimates, Scale, ValueType)
*/
@Override
public Object getActualInstance() {
return super.getActualInstance();
}
/**
* Get the actual instance of `CurrencyCode`. If the actual instance is not `CurrencyCode`,
* the ClassCastException will be thrown.
*
* @return The actual instance of `CurrencyCode`
* @throws ClassCastException if the instance is not `CurrencyCode`
*/
public CurrencyCode getCurrencyCode() throws ClassCastException {
return (CurrencyCode)super.getActualInstance();
}
/**
* Get the actual instance of `CurrencySymbol`. If the actual instance is not `CurrencySymbol`,
* the ClassCastException will be thrown.
*
* @return The actual instance of `CurrencySymbol`
* @throws ClassCastException if the instance is not `CurrencySymbol`
*/
public CurrencySymbol getCurrencySymbol() throws ClassCastException {
return (CurrencySymbol)super.getActualInstance();
}
/**
* Get the actual instance of `Category`. If the actual instance is not `Category`,
* the ClassCastException will be thrown.
*
* @return The actual instance of `Category`
* @throws ClassCastException if the instance is not `Category`
*/
public Category getCategory() throws ClassCastException {
return (Category)super.getActualInstance();
}
/**
* Get the actual instance of `MetricEstimates`. If the actual instance is not `MetricEstimates`,
* the ClassCastException will be thrown.
*
* @return The actual instance of `MetricEstimates`
* @throws ClassCastException if the instance is not `MetricEstimates`
*/
public MetricEstimates getMetricEstimates() throws ClassCastException {
return (MetricEstimates)super.getActualInstance();
}
/**
* Get the actual instance of `ValueType`. If the actual instance is not `ValueType`,
* the ClassCastException will be thrown.
*
* @return The actual instance of `ValueType`
* @throws ClassCastException if the instance is not `ValueType`
*/
public ValueType getValueType() throws ClassCastException {
return (ValueType)super.getActualInstance();
}
/**
* Get the actual instance of `Scale`. If the actual instance is not `Scale`,
* the ClassCastException will be thrown.
*
* @return The actual instance of `Scale`
* @throws ClassCastException if the instance is not `Scale`
*/
public Scale getScale() throws ClassCastException {
return (Scale)super.getActualInstance();
}
/**
* Get the actual instance of `Description`. If the actual instance is not `Description`,
* the ClassCastException will be thrown.
*
* @return The actual instance of `Description`
* @throws ClassCastException if the instance is not `Description`
*/
public Description getDescription() throws ClassCastException {
return (Description)super.getActualInstance();
}
/**
* Get the actual instance of `Frequency`. If the actual instance is not `Frequency`,
* the ClassCastException will be thrown.
*
* @return The actual instance of `Frequency`
* @throws ClassCastException if the instance is not `Frequency`
*/
public Frequency getFrequency() throws ClassCastException {
return (Frequency)super.getActualInstance();
}
}