org.hackystat.dailyprojectdata.resource.commit
Class CommitData

java.lang.Object
  extended by org.hackystat.dailyprojectdata.resource.commit.CommitData

public class CommitData
extends java.lang.Object

The class wrapping SensorData instance, which provides easy access to the commit specific properties.

Author:
aito

Constructor Summary
CommitData(org.hackystat.sensorbase.resource.sensordata.jaxb.SensorData data)
          Constructs this object with the specified SensorData instance.
 
Method Summary
 boolean equals(java.lang.Object object)
          Returns true if the specified object equals this object.
 org.hackystat.sensorbase.resource.sensordata.jaxb.Property getCommitProperty(java.lang.String propertyName)
          Returns the Property instance with the specified property name.
 org.hackystat.sensorbase.resource.sensordata.jaxb.Property getCommitProperty(java.lang.String propertyName, java.lang.String defaultValue)
          Returns the Property instance with the specified property name.
 int getLinesAdded()
          Returns the total lines added stored in this data instance.
 int getLinesDeleted()
          Returns the total lines deleted stored in this data instance.
 int getLinesModified()
          Returns the total lines modified in this data instance.
 java.lang.String getOwner()
          Returns the owner of the wrapped data instance.
 int hashCode()
          Returns the hashcode of this object.
 java.lang.String toString()
          Returns the string representation of this data object, which is useful for debugging purposes.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CommitData

public CommitData(org.hackystat.sensorbase.resource.sensordata.jaxb.SensorData data)
Constructs this object with the specified SensorData instance.

Parameters:
data - the specified data instance.
Method Detail

getOwner

public java.lang.String getOwner()
Returns the owner of the wrapped data instance.

Returns:
the data owner.

getLinesAdded

public int getLinesAdded()
Returns the total lines added stored in this data instance.

Returns:
the total lines added.

getLinesDeleted

public int getLinesDeleted()
Returns the total lines deleted stored in this data instance.

Returns:
the total lines deleted.

getLinesModified

public int getLinesModified()
Returns the total lines modified in this data instance. Note that linesModified is an optional property, so this will return 0 if not present.

Returns:
the total lines modified

equals

public boolean equals(java.lang.Object object)
Returns true if the specified object equals this object.

Overrides:
equals in class java.lang.Object
Parameters:
object - the object to test.
Returns:
true if equal, false if not.

hashCode

public int hashCode()
Returns the hashcode of this object.

Overrides:
hashCode in class java.lang.Object
Returns:
the hashcode.

getCommitProperty

public org.hackystat.sensorbase.resource.sensordata.jaxb.Property getCommitProperty(java.lang.String propertyName)
Returns the Property instance with the specified property name. If no property exists, null is returned.

Parameters:
propertyName - the property name to search for.
Returns:
the property with the specified name or null.

getCommitProperty

public org.hackystat.sensorbase.resource.sensordata.jaxb.Property getCommitProperty(java.lang.String propertyName,
                                                                                    java.lang.String defaultValue)
Returns the Property instance with the specified property name. If no property exists, defaultValue is returned.

Parameters:
propertyName - the property name to search for.
defaultValue - The string to return if the property does not exist.
Returns:
The property with the specified name or defaultValue.

toString

public java.lang.String toString()
Returns the string representation of this data object, which is useful for debugging purposes.

Overrides:
toString in class java.lang.Object
Returns:
the string representation.