Package oracle.nosql.driver
Class FreeFormTags
- java.lang.Object
-
- oracle.nosql.driver.FreeFormTags
-
- All Implemented Interfaces:
Iterable<Map.Entry<String,FieldValue>>
public class FreeFormTags extends Object implements Iterable<Map.Entry<String,FieldValue>>
Cloud service only. FreeFormTags is a class to encapsulate free-form 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 FreeFormTags()
Creates a new instance of FreeFormTags.FreeFormTags(String jsonString)
Creates a new instance of FreeFormTags from JSON string input.FreeFormTags(Map<String,String> map)
Creates a new instance of FreeFormTags from a Map
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FreeFormTags
addTag(String key, String value)
Adds a new tag to the set of tagsboolean
contains(String key)
Returns true if the specified key exists in the tags mapString
getTag(String key)
Returns the value of the named tag or null if it does not existIterator<Map.Entry<String,FieldValue>>
iterator()
int
size()
Returns the number of tags in the setString
toString()
Returns the free-form tags as a JSON string-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
FreeFormTags
public FreeFormTags()
Creates a new instance of FreeFormTags. This method along withaddTag(java.lang.String, java.lang.String)
is used to add tags to a call to create or modify a table.
-
FreeFormTags
public FreeFormTags(String jsonString)
Creates a new instance of FreeFormTags from JSON string input.- Parameters:
jsonString
- a JSON string
-
-
Method Detail
-
addTag
public FreeFormTags addTag(String key, String value)
Adds a new tag to the set of tags- Parameters:
key
- the tag keyvalue
- the tag value- Returns:
- this
-
getTag
public String getTag(String key)
Returns the value of the named tag or null if it does not exist- Parameters:
key
- the key- Returns:
- the tag value or null
-
size
public int size()
Returns the number of tags in the set- Returns:
- the size
-
contains
public boolean contains(String key)
Returns true if the specified key exists in the tags map- Parameters:
key
- the key- Returns:
- true if the key exists
-
toString
public String toString()
Returns the free-form tags as a JSON string
-
iterator
public Iterator<Map.Entry<String,FieldValue>> iterator()
- Specified by:
iterator
in interfaceIterable<Map.Entry<String,FieldValue>>
-
-