org.w3c.ddr.simple
Interface Evidence


public interface Evidence

An interface representing evidence that is to be supplied to getPropertyValue or getPropertyValues methods of Service. The purpose of Evidence is to represent available information with which to identify the delivery context. In accordance with the minimum requirements of the DDR Simple API, this interface can support the representation of evidence as HTTP headers. Consumers of HTTP evidence must support case-insensitive field names as per RFC 2616 section 4.2.

Author:
Jo Rabin (dotMobi),
Jose Manuel Cantera Fonseca (Telefonica I+D),
Rotan Hanrahan (MobileAware),
Ignacio Marin (Fundacion CTIC)
Copyright © 2008 W3C® (MIT, ERCIM, Keio), All Rights Reserved.
W3C liability, trademark and document use rules apply.
See Also:
Service.newHTTPEvidence()

Method Summary
 boolean exists(java.lang.String key)
          True if a value for the specified key exists.
 java.lang.String get(java.lang.String key)
          Get the value corresponding to the key.
 void put(java.lang.String key, java.lang.String value)
          Add a key / value pair to the collection of evidence.
 

Method Detail

put

void put(java.lang.String key,
         java.lang.String value)
Add a key / value pair to the collection of evidence. Any value put into evidence via this method can be retrieved via a corresponding call to get(key).

Parameters:
key - The key that identifies an element of the evidence.
value - The value of the identified element.

exists

boolean exists(java.lang.String key)
True if a value for the specified key exists.

Parameters:
key - The unique key that identifies an element of the evidence.
Returns:
The value 'true' if the identified element has a value that can be retrieved, and 'false' otherwise.

get

java.lang.String get(java.lang.String key)
Get the value corresponding to the key. For a particular key K, if there was a previous call to put(K,value) then the value returned by get(K) will be the most recent value used in put(K,value).

Parameters:
key - The key that identifies an element of the evidence.
Returns:
The value of the element identified by the key.