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

com.ibm.cloud.objectstorage.protocol.MarshallingType Maven / Gradle / Ivy

Go to download

A single bundled dependency that includes all service and dependent JARs with third-party libraries relocated to different namespaces.

There is a newer version: 2.13.4
Show newest version
/*
 * Copyright 2011-2017 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.ibm.cloud.objectstorage.protocol;

import java.io.InputStream;
import java.math.BigDecimal;
import java.nio.ByteBuffer;
import java.util.Date;
import java.util.List;
import java.util.Map;

import com.ibm.cloud.objectstorage.annotation.SdkProtectedApi;

/**
 * Represents the various types supported for marshalling.
 *
 * @param  Java type bound to the marshalling type.
 */
@SdkProtectedApi
public interface MarshallingType {
    /**
     * Determine whether this marshalling type is the default marshaller for the provided class. This is used to automatically
     * determine the marshaller to be used in the contents of lists or maps.
     */
    boolean isDefaultMarshallerForType(Class type);

    /**
     * Used when a value is null (and thus type can't be determined).
     */
    MarshallingType NULL = new DefaultMarshallingType(Void.class);

    MarshallingType STRING = new DefaultMarshallingType(String.class);

    MarshallingType INTEGER = new DefaultMarshallingType(Integer.class);

    MarshallingType LONG = new DefaultMarshallingType(Long.class);

    MarshallingType FLOAT = new DefaultMarshallingType(Float.class);

    MarshallingType DOUBLE = new DefaultMarshallingType(Double.class);

    MarshallingType BIG_DECIMAL = new DefaultMarshallingType(BigDecimal.class);

    MarshallingType BOOLEAN = new DefaultMarshallingType(Boolean.class);

    MarshallingType DATE = new DefaultMarshallingType(Date.class);

    MarshallingType BYTE_BUFFER = new DefaultMarshallingType(ByteBuffer.class);

    MarshallingType STREAM = new DefaultMarshallingType(InputStream.class);

    MarshallingType STRUCTURED = new DefaultMarshallingType(StructuredPojo.class);

    MarshallingType LIST = new DefaultMarshallingType(List.class);

    MarshallingType MAP = new DefaultMarshallingType(Map.class);

    /**
     * A serializer for strings that should be base-64 encoded when they are sent to AWS.
     */
    MarshallingType JSON_VALUE = new MarshallingType() {
        @Override
        public boolean isDefaultMarshallerForType(Class type) {
            return false;
        }
    };

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy