com.petpet.c3po.api.model
Class Element

java.lang.Object
  extended by com.petpet.c3po.api.model.Element
All Implemented Interfaces:
Model

public class Element
extends Object
implements Model

A domain object class that encapsulates a digital object and its meta data. It consists of a couple of attributes that describe a simple object (usually a file) and a list of specific metadata.

Author:
Petar Petrov

Constructor Summary
Element(String uid, String name)
          Creates an element with the given uid and name.
Element(String collection, String uid, String name)
          Creates an element with the given uid, name and collection.
 
Method Summary
 String getCollection()
           
 String getId()
           
 List<MetadataRecord> getMetadata()
           
 String getName()
           
 String getUid()
           
 List<MetadataRecord> removeMetadata(String property)
          Removes all records for the given property id and returns a list of all removed meta data records.
 void setCollection(String collection)
           
 void setId(String id)
           
 void setMetadata(List<MetadataRecord> metadata)
           
 void setName(String name)
           
 void setUid(String uid)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Element

public Element(String uid,
               String name)
Creates an element with the given uid and name.

Parameters:
uid - the unique identifier of this element.
name - the name of this element.

Element

public Element(String collection,
               String uid,
               String name)
Creates an element with the given uid, name and collection.

Parameters:
collection -
uid -
name -
Method Detail

getCollection

public String getCollection()

setCollection

public void setCollection(String collection)

getName

public String getName()

setName

public void setName(String name)

getUid

public String getUid()

setUid

public void setUid(String uid)

getMetadata

public List<MetadataRecord> getMetadata()

setMetadata

public void setMetadata(List<MetadataRecord> metadata)

getId

public String getId()

setId

public void setId(String id)

removeMetadata

public List<MetadataRecord> removeMetadata(String property)
Removes all records for the given property id and returns a list of all removed meta data records.

Parameters:
property - the id of the property
Returns:
returns the records of the element matching this property that were deleted.


Copyright © 2013. All Rights Reserved.