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

com.orbitz.consul.option.PutOptions Maven / Gradle / Ivy

package com.orbitz.consul.option;

import java.util.Optional;
import org.immutables.value.Value;

import java.util.HashMap;
import java.util.Map;

import static com.orbitz.consul.option.Options.optionallyAdd;

@Value.Immutable
public abstract class PutOptions implements ParamAdder {
    
    public static final PutOptions BLANK = ImmutablePutOptions.builder().build();
    
    public abstract Optional getCas();
    public abstract Optional getAcquire();
    public abstract Optional getRelease();
    public abstract Optional getDc();
    public abstract Optional getToken();

    @Override
    public final Map toQuery() {
        Map result = new HashMap<>();

        optionallyAdd(result, "dc", getDc());
        optionallyAdd(result, "cas", getCas());
        optionallyAdd(result, "acquire", getAcquire());
        optionallyAdd(result, "release", getRelease());
        optionallyAdd(result, "token", getToken());

        return result;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy