SMILA 1.0 API documentation

org.eclipse.smila.datamodel.impl
Class RecordImpl

java.lang.Object
  extended by org.eclipse.smila.datamodel.impl.RecordImpl
All Implemented Interfaces:
java.io.Serializable, Record

public class RecordImpl
extends java.lang.Object
implements Record, java.io.Serializable

Default implementation of SMILA Records.

Author:
jschumacher
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.eclipse.smila.datamodel.Record
RECORD_ID, SOURCE
 
Method Summary
 int attachmentSize()
          get number of attachments.
 Attachment getAttachment(java.lang.String name)
          get attachment value with the specified name.
 byte[] getAttachmentAsBytes(java.lang.String name)
          get attachment value for the specified name.
 java.util.Iterator<java.lang.String> getAttachmentNames()
          Get iterator on names of attachments of this record.
 DataFactory getFactory()
          get record factory to use for adding objects to this record.
 java.lang.String getId()
          Get the ID of this record.
 AnyMap getMetadata()
          Get the metadata of this record.
 java.lang.String getSource()
          Get the data source of this record.
 boolean hasAttachment(java.lang.String name)
          check if this record has an attachment of the specified name.
 boolean hasAttachments()
          check if this record has attachments.
 void removeAttachment(java.lang.String name)
          remove attachment for specified name.
 void removeAttachments()
          remove attachments.
 void setAttachment(Attachment attachment)
          set attachment.
 void setAttachment(java.lang.String name, byte[] attachment)
          set attachment content for the specified name.
 void setId(java.lang.String id)
          Set the ID of this record.
 void setSource(java.lang.String source)
          Set the data source of this record.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getId

public java.lang.String getId()
Description copied from interface: Record
Get the ID of this record.

Specified by:
getId in interface Record
Returns:
record ID

getSource

public java.lang.String getSource()
Get the data source of this record.

Specified by:
getSource in interface Record
Returns:
data source

getMetadata

public AnyMap getMetadata()
Description copied from interface: Record
Get the metadata of this record. Contains attributes and other properties of this record.

Specified by:
getMetadata in interface Record
Returns:
the metadata describing this record.

attachmentSize

public int attachmentSize()
Description copied from interface: Record
get number of attachments.

Specified by:
attachmentSize in interface Record
Returns:
number of attachments.

getAttachment

public Attachment getAttachment(java.lang.String name)
Description copied from interface: Record
get attachment value with the specified name.

Specified by:
getAttachment in interface Record
Parameters:
name - attachment name.
Returns:
attachment.

getAttachmentAsBytes

public byte[] getAttachmentAsBytes(java.lang.String name)
Description copied from interface: Record
get attachment value for the specified name.

Specified by:
getAttachmentAsBytes in interface Record
Parameters:
name - attachment name.
Returns:
attachment content.

getAttachmentNames

public java.util.Iterator<java.lang.String> getAttachmentNames()
Description copied from interface: Record
Get iterator on names of attachments of this record. Returns empty iterator if record has no attachments.

Specified by:
getAttachmentNames in interface Record
Returns:
iterator on attachment names.

hasAttachments

public boolean hasAttachments()
Description copied from interface: Record
check if this record has attachments.

Specified by:
hasAttachments in interface Record
Returns:
true if this record has attachments, else false.

hasAttachment

public boolean hasAttachment(java.lang.String name)
Description copied from interface: Record
check if this record has an attachment of the specified name.

Specified by:
hasAttachment in interface Record
Parameters:
name - attachment name.
Returns:
true if this record has an attachment for this name, else false.

removeAttachment

public void removeAttachment(java.lang.String name)
Description copied from interface: Record
remove attachment for specified name.

Specified by:
removeAttachment in interface Record
Parameters:
name - attachment name.

removeAttachments

public void removeAttachments()
Description copied from interface: Record
remove attachments.

Specified by:
removeAttachments in interface Record

setAttachment

public void setAttachment(Attachment attachment)
Description copied from interface: Record
set attachment.

Specified by:
setAttachment in interface Record
Parameters:
attachment - the new attachment.

setAttachment

public void setAttachment(java.lang.String name,
                          byte[] attachment)
Description copied from interface: Record
set attachment content for the specified name.

Specified by:
setAttachment in interface Record
Parameters:
name - attachment name.
attachment - attachment value.

setId

public void setId(java.lang.String id)
Description copied from interface: Record
Set the ID of this record.

Specified by:
setId in interface Record
Parameters:
id - new record ID

setSource

public void setSource(java.lang.String source)
Description copied from interface: Record
Set the data source of this record.

Specified by:
setSource in interface Record
Parameters:
source - data source

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getFactory

public DataFactory getFactory()
Description copied from interface: Record
get record factory to use for adding objects to this record.

Specified by:
getFactory in interface Record
Returns:
record factory for this record.

SMILA 1.0 API documentation