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

com.amazonaws.services.redshiftdataapi.model.transform.ColumnMetadataMarshaller Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Redshift Data API module holds the client classes that are used for communicating with Redshift Data API Service

There is a newer version: 1.12.772
Show newest version
/*
 * Copyright 2019-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */
package com.amazonaws.services.redshiftdataapi.model.transform;

import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.redshiftdataapi.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * ColumnMetadataMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class ColumnMetadataMarshaller {

    private static final MarshallingInfo COLUMNDEFAULT_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("columnDefault").build();
    private static final MarshallingInfo ISCASESENSITIVE_BINDING = MarshallingInfo.builder(MarshallingType.BOOLEAN)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("isCaseSensitive").build();
    private static final MarshallingInfo ISCURRENCY_BINDING = MarshallingInfo.builder(MarshallingType.BOOLEAN)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("isCurrency").build();
    private static final MarshallingInfo ISSIGNED_BINDING = MarshallingInfo.builder(MarshallingType.BOOLEAN)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("isSigned").build();
    private static final MarshallingInfo LABEL_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("label").build();
    private static final MarshallingInfo LENGTH_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("length").build();
    private static final MarshallingInfo NAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("name").build();
    private static final MarshallingInfo NULLABLE_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("nullable").build();
    private static final MarshallingInfo PRECISION_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("precision").build();
    private static final MarshallingInfo SCALE_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("scale").build();
    private static final MarshallingInfo SCHEMANAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("schemaName").build();
    private static final MarshallingInfo TABLENAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("tableName").build();
    private static final MarshallingInfo TYPENAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("typeName").build();

    private static final ColumnMetadataMarshaller instance = new ColumnMetadataMarshaller();

    public static ColumnMetadataMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(ColumnMetadata columnMetadata, ProtocolMarshaller protocolMarshaller) {

        if (columnMetadata == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            protocolMarshaller.marshall(columnMetadata.getColumnDefault(), COLUMNDEFAULT_BINDING);
            protocolMarshaller.marshall(columnMetadata.getIsCaseSensitive(), ISCASESENSITIVE_BINDING);
            protocolMarshaller.marshall(columnMetadata.getIsCurrency(), ISCURRENCY_BINDING);
            protocolMarshaller.marshall(columnMetadata.getIsSigned(), ISSIGNED_BINDING);
            protocolMarshaller.marshall(columnMetadata.getLabel(), LABEL_BINDING);
            protocolMarshaller.marshall(columnMetadata.getLength(), LENGTH_BINDING);
            protocolMarshaller.marshall(columnMetadata.getName(), NAME_BINDING);
            protocolMarshaller.marshall(columnMetadata.getNullable(), NULLABLE_BINDING);
            protocolMarshaller.marshall(columnMetadata.getPrecision(), PRECISION_BINDING);
            protocolMarshaller.marshall(columnMetadata.getScale(), SCALE_BINDING);
            protocolMarshaller.marshall(columnMetadata.getSchemaName(), SCHEMANAME_BINDING);
            protocolMarshaller.marshall(columnMetadata.getTableName(), TABLENAME_BINDING);
            protocolMarshaller.marshall(columnMetadata.getTypeName(), TYPENAME_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy