Package oracle.nosql.driver
Class FreeFormTags
java.lang.Object
oracle.nosql.driver.FreeFormTags
- All Implemented Interfaces:
Iterable<Map.Entry<String,
FieldValue>>
Cloud service only.
FreeFormTags is a class to encapsulate free-form tags which are returned
from calls to
NoSQLHandle.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
ConstructorDescriptionCreates 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
Modifier and TypeMethodDescriptionAdds a new tag to the set of tagsboolean
Returns true if the specified key exists in the tags mapReturns the value of the named tag or null if it does not existiterator()
int
size()
Returns the number of tags in the settoString()
Returns the free-form tags as a JSON stringMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
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
Creates a new instance of FreeFormTags from JSON string input.- Parameters:
jsonString
- a JSON string
-
FreeFormTags
Creates a new instance of FreeFormTags from a Map- Parameters:
map
- the map
-
-
Method Details
-
addTag
Adds a new tag to the set of tags- Parameters:
key
- the tag keyvalue
- the tag value- Returns:
- this
-
getTag
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
Returns true if the specified key exists in the tags map- Parameters:
key
- the key- Returns:
- true if the key exists
-
toString
Returns the free-form tags as a JSON string -
iterator
- Specified by:
iterator
in interfaceIterable<Map.Entry<String,
FieldValue>>
-