|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.enterprise.adaptor.Metadata
public class Metadata
Allows storing multiple metadata values to a single key.
Null keys are invalid as arguments. Null values are invalid as arguments.
This class is mutable and not thread-safe.
Constructor Summary | |
---|---|
Metadata()
Create empty instance. |
|
Metadata(Iterable<Map.Entry<String,String>> m)
Duplicate. |
Method Summary | |
---|---|
void |
add(String k,
String v)
Increases values mapped to k with v. |
boolean |
equals(Object o)
True if exactly the same key-values are represented. |
Set<String> |
getAllValues(String key)
Gives unmodifiable reference to inserted values for key, empty if none. |
Set<String> |
getKeys()
Get modifiable set of all keys with at least one value. |
String |
getOneValue(String key)
One of the inserted values, or null if none. |
int |
hashCode()
|
boolean |
isEmpty()
True with 0 entries. |
Iterator<Map.Entry<String,String>> |
iterator()
Provides every key and value in immutable entries sorted alphabetically, first by key, and secondly by value. |
void |
set(Iterable<Map.Entry<String,String>> it)
Replaces entries inside of this metadata with provided ones. |
void |
set(String k,
Set<String> v)
Make copy of v be the values associated with key. |
void |
set(String k,
String v)
Make v be only value associated with key. |
String |
toString()
Contains every key and value pair; useful for debugging. |
Metadata |
unmodifiableView()
Get a reference to an unmodifiable view of this object. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Metadata()
public Metadata(Iterable<Map.Entry<String,String>> m)
Method Detail |
---|
public void set(String k, String v)
public void set(String k, Set<String> v)
public void add(String k, String v)
public void set(Iterable<Map.Entry<String,String>> it)
public Set<String> getAllValues(String key)
public String getOneValue(String key)
public Set<String> getKeys()
public Iterator<Map.Entry<String,String>> iterator()
Behaviour is undefined if backing Metadata instance is modified during iteration.
remove() is unsupported on returned iterator.
iterator
in interface Iterable<Map.Entry<String,String>>
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public boolean isEmpty()
public String toString()
toString
in class Object
public Metadata unmodifiableView()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |