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

com.airbyte.api.models.shared.SourceMicrosoftOnedriveParquetFormat Maven / Gradle / Ivy

The newest version!
/* 
 * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
 */

package com.airbyte.api.models.shared;

import com.airbyte.api.utils.LazySingletonValue;
import com.airbyte.api.utils.Utils;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.type.TypeReference;
import java.io.InputStream;
import java.lang.Deprecated;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Optional;

public class SourceMicrosoftOnedriveParquetFormat {

    /**
     * Whether to convert decimal fields to floats. There is a loss of precision when converting decimals to floats, so this is not recommended.
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("decimal_as_float")
    private Optional decimalAsFloat;

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("filetype")
    private Optional filetype;

    @JsonCreator
    public SourceMicrosoftOnedriveParquetFormat(
            @JsonProperty("decimal_as_float") Optional decimalAsFloat) {
        Utils.checkNotNull(decimalAsFloat, "decimalAsFloat");
        this.decimalAsFloat = decimalAsFloat;
        this.filetype = Builder._SINGLETON_VALUE_Filetype.value();
    }
    
    public SourceMicrosoftOnedriveParquetFormat() {
        this(Optional.empty());
    }

    /**
     * Whether to convert decimal fields to floats. There is a loss of precision when converting decimals to floats, so this is not recommended.
     */
    @SuppressWarnings("unchecked")
    @JsonIgnore
    public Optional decimalAsFloat() {
        return (Optional) decimalAsFloat;
    }

    @SuppressWarnings("unchecked")
    @JsonIgnore
    public Optional filetype() {
        return (Optional) filetype;
    }

    public final static Builder builder() {
        return new Builder();
    }

    /**
     * Whether to convert decimal fields to floats. There is a loss of precision when converting decimals to floats, so this is not recommended.
     */
    public SourceMicrosoftOnedriveParquetFormat withDecimalAsFloat(boolean decimalAsFloat) {
        Utils.checkNotNull(decimalAsFloat, "decimalAsFloat");
        this.decimalAsFloat = Optional.ofNullable(decimalAsFloat);
        return this;
    }

    /**
     * Whether to convert decimal fields to floats. There is a loss of precision when converting decimals to floats, so this is not recommended.
     */
    public SourceMicrosoftOnedriveParquetFormat withDecimalAsFloat(Optional decimalAsFloat) {
        Utils.checkNotNull(decimalAsFloat, "decimalAsFloat");
        this.decimalAsFloat = decimalAsFloat;
        return this;
    }
    
    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        SourceMicrosoftOnedriveParquetFormat other = (SourceMicrosoftOnedriveParquetFormat) o;
        return 
            java.util.Objects.deepEquals(this.decimalAsFloat, other.decimalAsFloat) &&
            java.util.Objects.deepEquals(this.filetype, other.filetype);
    }
    
    @Override
    public int hashCode() {
        return java.util.Objects.hash(
            decimalAsFloat,
            filetype);
    }
    
    @Override
    public String toString() {
        return Utils.toString(SourceMicrosoftOnedriveParquetFormat.class,
                "decimalAsFloat", decimalAsFloat,
                "filetype", filetype);
    }
    
    public final static class Builder {
 
        private Optional decimalAsFloat;  
        
        private Builder() {
          // force use of static builder() method
        }

        /**
         * Whether to convert decimal fields to floats. There is a loss of precision when converting decimals to floats, so this is not recommended.
         */
        public Builder decimalAsFloat(boolean decimalAsFloat) {
            Utils.checkNotNull(decimalAsFloat, "decimalAsFloat");
            this.decimalAsFloat = Optional.ofNullable(decimalAsFloat);
            return this;
        }

        /**
         * Whether to convert decimal fields to floats. There is a loss of precision when converting decimals to floats, so this is not recommended.
         */
        public Builder decimalAsFloat(Optional decimalAsFloat) {
            Utils.checkNotNull(decimalAsFloat, "decimalAsFloat");
            this.decimalAsFloat = decimalAsFloat;
            return this;
        }
        
        public SourceMicrosoftOnedriveParquetFormat build() {
            if (decimalAsFloat == null) {
                decimalAsFloat = _SINGLETON_VALUE_DecimalAsFloat.value();
            }
            return new SourceMicrosoftOnedriveParquetFormat(
                decimalAsFloat);
        }

        private static final LazySingletonValue> _SINGLETON_VALUE_DecimalAsFloat =
                new LazySingletonValue<>(
                        "decimal_as_float",
                        "false",
                        new TypeReference>() {});

        private static final LazySingletonValue> _SINGLETON_VALUE_Filetype =
                new LazySingletonValue<>(
                        "filetype",
                        "\"parquet\"",
                        new TypeReference>() {});
    }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy