public class Metadata extends Object
Map
of String
keys mapped to Object
values. So, each key can map to potentially many values, but also can map to
null, or to a single value.Modifier and Type | Class and Description |
---|---|
protected class |
Metadata.Group |
Modifier and Type | Method and Description |
---|---|
void |
addMetadata(Hashtable<String,Object> metadata)
Deprecated.
|
void |
addMetadata(Map<String,Object> metadata) |
void |
addMetadata(Map<String,Object> metadata,
boolean replace)
Deprecated.
|
void |
addMetadata(Metadata metadata)
Adds (Appends if key exists) from given metadata into this metadata
|
void |
addMetadata(String key,
List<String> values)
Adds key (Appends if key exists)
|
void |
addMetadata(String group,
Metadata metadata) |
void |
addMetadata(String key,
String value)
Adds key (Appends if key exists)
|
boolean |
containsGroup(String group) |
boolean |
containsKey(String key)
Checks if keys exists
|
protected Metadata.Group |
createNewRoot() |
boolean |
equals(Object obj) |
List<String> |
getAllKeys()
Gets all keys in this Metadata
|
protected List<String> |
getAllKeys(Metadata.Group group) |
List<String> |
getAllKeys(String group)
Gets All key in and below given group
|
List<String> |
getAllKeysWithName(String key)
Get all keys whose leaf key name is equal to the given arg
|
List<String> |
getAllMetadata(String key)
Gets all values for give key
|
List<String> |
getAllValues()
Gets all values in this Metadata
|
List<String> |
getAllValues(String group)
Gets All values in and below given group
|
protected Metadata.Group |
getGroup(String key) |
protected Metadata.Group |
getGroup(String key,
boolean create) |
List<String> |
getGroups() |
protected List<String> |
getGroups(Metadata.Group group) |
List<String> |
getGroups(String group) |
Hashtable<String,Object> |
getHashTable()
Deprecated.
|
List<String> |
getKeys()
Gets all keys in this Metadata
|
protected List<String> |
getKeys(Metadata.Group group) |
List<String> |
getKeys(String group)
Gets All key in and below given group
|
Map<String,Object> |
getMap() |
String |
getMetadata(String key)
Gets the first value for the given key
|
Metadata |
getSubMetadata(String group)
Creates a Metadata from the given group
|
List<String> |
getValues()
Gets Values in root group
|
List<String> |
getValues(String group)
Gets values in given group
|
int |
hashCode() |
boolean |
isMultiValued(String key)
Checks if key has more than one value
|
void |
removeMetadata(String key)
Removes key
|
void |
removeMetadataGroup(String group)
Removes key
|
void |
replaceMetadata(Map<String,Object> metadata) |
void |
replaceMetadata(Metadata metadata)
Adds (Replaces if key exists) from given Metadata into this Metadata
|
void |
replaceMetadata(String key,
List<String> values)
Adds key (Replaces if key exists)
|
void |
replaceMetadata(String group,
Metadata metadata) |
void |
replaceMetadata(String key,
String value)
Adds key (Replaces if key exists)
|
public Metadata()
public Metadata(Metadata metadata)
public void addMetadata(Metadata metadata)
metadata
- Metadata to add metadata frompublic void replaceMetadata(Metadata metadata)
metadata
- public void addMetadata(String key, String value)
key
- Key to be addedvalue
- Value of key to be addedpublic void replaceMetadata(String key, String value)
key
- Key to be addedvalue
- Value of key to be addedpublic void addMetadata(String key, List<String> values)
key
- Key to be addedvalues
- Values of key to be addedpublic void replaceMetadata(String key, List<String> values)
key
- Key to be addedvalues
- Values of key to be addedpublic void removeMetadata(String key)
key
- Key to removepublic void removeMetadataGroup(String group)
public boolean containsKey(String key)
key
- Key to check forpublic boolean isMultiValued(String key)
key
- Key to check forpublic Metadata getSubMetadata(String group)
group
- The Group to grabpublic String getMetadata(String key)
key
- The key for which the first value will be returnedpublic List<String> getAllMetadata(String key)
key
- The key for which all values will be returnpublic List<String> getKeys(String group)
group
- The group in questionpublic List<String> getKeys()
protected List<String> getKeys(Metadata.Group group)
public List<String> getAllKeys(String group)
group
- The group in questionpublic List<String> getAllKeys()
protected List<String> getAllKeys(Metadata.Group group)
public List<String> getAllKeysWithName(String key)
key
- leaf key namepublic List<String> getValues()
public List<String> getValues(String group)
group
- Group in questionpublic List<String> getAllValues()
public List<String> getAllValues(String group)
group
- Group in question@Deprecated public void addMetadata(Hashtable<String,Object> metadata)
@Deprecated public void addMetadata(Map<String,Object> metadata, boolean replace)
metadata
- Map based metadata to addreplace
- If true, existing keys will be replaced, other values will be
combined.public boolean containsGroup(String group)
protected List<String> getGroups(Metadata.Group group)
protected Metadata.Group getGroup(String key)
protected Metadata.Group getGroup(String key, boolean create)
protected Metadata.Group createNewRoot()
@Deprecated public Hashtable<String,Object> getHashTable()
Copyright © 1999–2017 Apache OODT. All rights reserved.