org.apache.jackrabbit.core.data
Class AbstractDataRecord

java.lang.Object
  extended by org.apache.jackrabbit.core.data.AbstractDataRecord
All Implemented Interfaces:
DataRecord
Direct Known Subclasses:
DbDataRecord, FileDataRecord

public abstract class AbstractDataRecord
extends Object
implements DataRecord

Abstract data record base class. This base class contains only a reference to the data identifier of the record and implements the standard Object equality, hash code, and string representation methods based on the identifier.


Constructor Summary
AbstractDataRecord(DataIdentifier identifier)
          Creates a data record with the given identifier.
 
Method Summary
 boolean equals(Object object)
          Checks if the given object is a data record with the same identifier as this one.
 DataIdentifier getIdentifier()
          Returns the data identifier.
 int hashCode()
          Returns the hash code of the data identifier.
 String toString()
          Returns the string representation of the data identifier.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.jackrabbit.core.data.DataRecord
getLastModified, getLength, getStream
 

Constructor Detail

AbstractDataRecord

public AbstractDataRecord(DataIdentifier identifier)
Creates a data record with the given identifier.

Parameters:
identifier - data identifier
Method Detail

getIdentifier

public DataIdentifier getIdentifier()
Returns the data identifier.

Specified by:
getIdentifier in interface DataRecord
Returns:
data identifier

toString

public String toString()
Returns the string representation of the data identifier.

Overrides:
toString in class Object
Returns:
string representation

equals

public boolean equals(Object object)
Checks if the given object is a data record with the same identifier as this one.

Overrides:
equals in class Object
Parameters:
object - other object
Returns:
true if the other object is a data record and has the same identifier as this one, false otherwise

hashCode

public int hashCode()
Returns the hash code of the data identifier.

Overrides:
hashCode in class Object
Returns:
hash code


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.