public class Metadata extends Object implements org.apache.hadoop.io.Writable, CreativeCommons, DublinCore, HttpHeaders, Nutch, Feed
LICENSE_LOCATION, LICENSE_URL, WORK_TYPE
CONTRIBUTOR, COVERAGE, CREATOR, DATE, DESCRIPTION, FORMAT, IDENTIFIER, LANGUAGE, MODIFIED, PUBLISHER, RELATION, RIGHTS, SOURCE, SUBJECT, TITLE, TYPE
CONTENT_DISPOSITION, CONTENT_ENCODING, CONTENT_LANGUAGE, CONTENT_LENGTH, CONTENT_LOCATION, CONTENT_MD5, CONTENT_TYPE, LAST_MODIFIED, LOCATION, WRITABLE_CONTENT_TYPE
CACHING_FORBIDDEN_ALL, CACHING_FORBIDDEN_CONTENT, CACHING_FORBIDDEN_KEY, CACHING_FORBIDDEN_NONE, CHAR_ENCODING_FOR_CONVERSION, FETCH_STATUS_KEY, FETCH_TIME_KEY, FIXED_INTERVAL_KEY, GENERATE_TIME_KEY, ORIGINAL_CHAR_ENCODING, PROTO_STATUS_KEY, REPR_URL_KEY, SCORE_KEY, SEGMENT_NAME_KEY, SIGNATURE_KEY, WRITABLE_FIXED_INTERVAL_KEY, WRITABLE_GENERATE_TIME_KEY, WRITABLE_PROTO_STATUS_KEY, WRITABLE_REPR_URL_KEY
FEED, FEED_AUTHOR, FEED_PUBLISHED, FEED_TAGS, FEED_UPDATED
Constructor and Description |
---|
Metadata()
Constructs a new, empty metadata.
|
Modifier and Type | Method and Description |
---|---|
void |
add(String name,
String value)
Add a metadata name/value mapping.
|
void |
clear()
Remove all mappings from metadata.
|
boolean |
equals(Object o) |
String |
get(String name)
Get the value associated to a metadata name.
|
String[] |
getValues(String name)
Get the values associated to a metadata name.
|
boolean |
isMultiValued(String name)
Returns true if named value is multivalued.
|
String[] |
names()
Returns an array of the names contained in the metadata.
|
void |
readFields(DataInput in) |
void |
remove(String name)
Remove a metadata and all its associated values.
|
void |
set(String name,
String value)
Set metadata name/value.
|
void |
setAll(Properties properties)
Copy All key-value pairs from properties.
|
int |
size()
Returns the number of metadata names in this metadata.
|
String |
toString() |
void |
write(DataOutput out) |
public boolean isMultiValued(String name)
name
- name of metadatapublic String[] names()
public String get(String name)
name
- of the metadata.public String[] getValues(String name)
name
- of the metadata.public void add(String name, String value)
name
- the metadata name.value
- the metadata value.public void setAll(Properties properties)
properties
- properties to copy frompublic void set(String name, String value)
name
- the metadata name.value
- the metadata value.public void remove(String name)
name
- metadata name to removepublic int size()
public void clear()
public final void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
IOException
public final void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
IOException
Copyright © 2014 The Apache Software Foundation