public class KeyValueOptions extends Object
Constructor and Description |
---|
KeyValueOptions()
Default constructor
|
KeyValueOptions(JsonObject options)
Constructor from JSON
|
KeyValueOptions(KeyValueOptions options)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
String |
getAcquireSession()
Get session ID for lock acquisition operation.
|
long |
getCasIndex()
Get the Check-And-Set index.
|
long |
getFlags()
Get the flags.
|
String |
getReleaseSession()
Get session ID for lock release operation.
|
KeyValueOptions |
setAcquireSession(String acquireSession)
Set session ID for lock acquisition operation.
|
KeyValueOptions |
setCasIndex(long index)
Set the Check-And-Set index.
|
KeyValueOptions |
setFlags(long flags)
Set the flags.
|
KeyValueOptions |
setReleaseSession(String releaseSession)
Set session ID for lock release operation.
|
JsonObject |
toJson()
Convert to JSON
|
public KeyValueOptions()
public KeyValueOptions(KeyValueOptions options)
options
- the one to copypublic KeyValueOptions(JsonObject options)
options
- the JSONpublic JsonObject toJson()
public String getAcquireSession()
public KeyValueOptions setAcquireSession(String acquireSession)
acquireSession
- the ID of sessionpublic String getReleaseSession()
public KeyValueOptions setReleaseSession(String releaseSession)
releaseSession
- the ID of sessionpublic long getFlags()
0
and 264-1 that can be attached to each entry.
Clients can choose to use this however makes sense for their application.public KeyValueOptions setFlags(long flags)
0
and 264-1 that can be attached to each entry.
Clients can choose to use this however makes sense for their application.flags
- the flagspublic long getCasIndex()
0
, Consul will only put the key if it does not already exist.
If the index is non-zero, the key is only set if the index matches the ModifyIndex of that key.KeyValue.getModifyIndex()
public KeyValueOptions setCasIndex(long index)
0
, Consul will only put the key if it does not already exist.
If the index is non-zero, the key is only set if the index matches the ModifyIndex of that key.index
- the Check-And-Set indexKeyValue.getModifyIndex()
Copyright © 2022 Eclipse. All rights reserved.