com.ldodds.foaf.thinlet.model
Interface Annotable

All Known Implementing Classes:
AnnotableObject

public interface Annotable

Describes an object that can be annotated with arbitrary name-value pairs

This code is Public Domain.

Version:
$Id$
Author:
Leigh Dodds

Method Summary
 void add(Annotable other)
          Copies properties from one Annotable object into another.
 void add(java.lang.String property, java.lang.Object value)
          Adds a property to this object.
 void addAsList(java.lang.String property, java.lang.Object value)
          Adds a list property to this object.
 java.lang.Object get(java.lang.String property)
          Gets a named property.
 java.util.List getAsList(java.lang.String property)
          Gets a named property as a List.
 java.util.Map getProperties()
          Get the list of properties defined in this object
 boolean has(java.lang.String property)
          Tests whether this Annotable has a given property
 

Method Detail

add

public void add(java.lang.String property,
                java.lang.Object value)
Adds a property to this object. Existing entries are overwritten.
Parameters:
property - the property name
value - the value of that property

addAsList

public void addAsList(java.lang.String property,
                      java.lang.Object value)
Adds a list property to this object.

add

public void add(Annotable other)
Copies properties from one Annotable object into another. Existing properties in this object will be overwritten from those defined in the other.
Parameters:
other - the object to copy properties from

get

public java.lang.Object get(java.lang.String property)
Gets a named property.
Parameters:
property - the name of the property
Returns:
the value of the property, or null if it is not set

getAsList

public java.util.List getAsList(java.lang.String property)
Gets a named property as a List.
Parameters:
property - the name of the property
Returns:
the list of values for this property. The list may be empty.

has

public boolean has(java.lang.String property)
Tests whether this Annotable has a given property
Parameters:
property - the property to check
Returns:
true if the property has a value, false otherwise

getProperties

public java.util.Map getProperties()
Get the list of properties defined in this object
Returns:
an unmodifiable Map of the properties