Package oracle.nosql.driver
Class DefinedTags
- java.lang.Object
-
- oracle.nosql.driver.DefinedTags
-
public class DefinedTags extends Object
Cloud service only. DefinedTags is a class to encapsulate defined tags which are returned from calls toNoSQLHandle.getTable(oracle.nosql.driver.ops.GetTableRequest)
. They can also be set during table creation operations as well as alter table operations.- Since:
- 5.4
-
-
Constructor Summary
Constructors Constructor Description DefinedTags()
Creates a new instance of DefinedTags.DefinedTags(String jsonString)
Creates a new instance of DefinedTags from JSON string input.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DefinedTags
addTag(String namespace, String key, String value)
Adds a new tag to the set of tags in the specified namespaceboolean
contains(String namespace, String key)
Returns true if the specified key exists in the specified namespaceString
getTag(String namespace, String key)
Returns the value of the named tag in the specified namespace or null if it does not existString
toString()
Returns the free-form tags as a JSON string
-
-
-
Constructor Detail
-
DefinedTags
public DefinedTags()
Creates a new instance of DefinedTags. This method along withaddTag(java.lang.String, java.lang.String, java.lang.String)
is used to add tags to a call to create or modify a table.
-
DefinedTags
public DefinedTags(String jsonString)
Creates a new instance of DefinedTags from JSON string input.- Parameters:
jsonString
- a JSON string
-
-
Method Detail
-
addTag
public DefinedTags addTag(String namespace, String key, String value)
Adds a new tag to the set of tags in the specified namespace- Parameters:
namespace
- the namespace for the tagkey
- the tag keyvalue
- the tag value- Returns:
- this
-
getTag
public String getTag(String namespace, String key)
Returns the value of the named tag in the specified namespace or null if it does not exist- Parameters:
namespace
- the namespacekey
- the key- Returns:
- the tag value or null
-
contains
public boolean contains(String namespace, String key)
Returns true if the specified key exists in the specified namespace- Parameters:
namespace
- the namespacekey
- the key- Returns:
- true if the key exists
-
-