public class SecretDocument extends Object
SecretDocument
is basically an object with an id
and a body
represented as Map
of String
and Object
. It can be created
from
an Id and
VaultResponse
.
A secret document can hold simple properties, list
properties and nested objects as Map
s.
Constructor and Description |
---|
SecretDocument()
Create a new, empty
SecretDocument . |
SecretDocument(Map<String,Object> body)
Create a new
SecretDocument given a body map . |
SecretDocument(String id) |
SecretDocument(String id,
Integer version,
Map<String,Object> body)
|
SecretDocument(String id,
Map<String,Object> body)
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
static SecretDocument |
from(String id,
VaultResponse vaultResponse)
|
Object |
get(String key)
Retrieve a value from the secret document by its
key . |
Map<String,Object> |
getBody() |
String |
getId() |
String |
getRequiredId()
Return the required Id or throw
IllegalStateException if the Id is not set. |
Integer |
getVersion() |
int |
hashCode() |
void |
put(String key,
Object value)
Set a value in the secret document.
|
void |
setId(String id)
Set the identifier value.
|
void |
setVersion(Integer version) |
String |
toString() |
public SecretDocument()
SecretDocument
.public SecretDocument(Map<String,Object> body)
SecretDocument
given a body map
.body
- must not be null.public SecretDocument(@Nullable String id, Map<String,Object> body)
id
- may be null.body
- must not be null.public SecretDocument(@Nullable String id, @Nullable Integer version, Map<String,Object> body)
id
- may be null.version
- for versioned secrets, may be null if not available.body
- must not be null.public SecretDocument(String id)
public static SecretDocument from(@Nullable String id, VaultResponse vaultResponse)
id
- must not be null.vaultResponse
- must not be null.SecretDocument
.public String getRequiredId()
IllegalStateException
if the Id is not set.IllegalStateException
- if the Id is not set.public void setId(@Nullable String id)
id
- may be null.@Nullable public Integer getVersion()
null
if absent.public Map<String,Object> getBody()
SecretDocument
@Nullable public Object get(String key)
key
.key
- must not be null.public void put(String key, Object value)
key
- must not be null.value
- must not be null.Copyright © 2016–2022 Pivotal Software, Inc.. All rights reserved.