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

com.azure.cosmos.implementation.patch.PatchOperationCore Maven / Gradle / Ivy

Go to download

This Package contains Microsoft Azure Cosmos SDK (with Reactive Extension Reactor support) for Azure Cosmos DB SQL API

There is a newer version: 4.61.1
Show newest version
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.azure.cosmos.implementation.patch;

import com.azure.cosmos.implementation.apachecommons.lang.StringUtils;

import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkArgument;

/**
 * @param  The type of value for this patch operation.
 */
public final class PatchOperationCore extends PatchOperation {

    private final String path;
    private final T resource;

    /**
     * Initializes a new instance of the {@link PatchOperationCore} class.
     *
     * @param operationType Specifies the type of Update operation
     * @param path          Specifies the path to target location.
     * @param value         Specifies the value to be used
     */
    public PatchOperationCore(PatchOperationType operationType, String path, T value) {
        super(operationType);

        checkArgument(StringUtils.isNotEmpty(path), "path empty %s", path);
        this.path = path;
        this.resource = value;
    }

    String getPath() {
        return path;
    }

    T getResource() {
        return resource;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy