ch.hsr.bieridee.models
Class AbstractActionModel

java.lang.Object
  extended by ch.hsr.bieridee.models.AbstractModel
      extended by ch.hsr.bieridee.models.AbstractActionModel
Direct Known Subclasses:
ConsumptionModel, RatingModel

public abstract class AbstractActionModel
extends AbstractModel

Abstract class for action models (consumtion and rating).


Constructor Summary
AbstractActionModel(java.lang.String type, org.neo4j.graphdb.Node node)
          Basic constructor of the ActionModel from a node.
 
Method Summary
 BeerModel getBeer()
           
 java.util.Date getDate()
           
 long getSecondsAgo()
           
 java.lang.String getType()
           
 UserModel getUser()
           
 
Methods inherited from class ch.hsr.bieridee.models.AbstractModel
getDomainObject, getNode
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractActionModel

public AbstractActionModel(java.lang.String type,
                           org.neo4j.graphdb.Node node)
                    throws org.neo4j.graphdb.NotFoundException,
                           WrongNodeTypeException
Basic constructor of the ActionModel from a node.

Parameters:
type - Type of the node
node - The action node, consumtion or rating
Throws:
org.neo4j.graphdb.NotFoundException - Thrown if the given node can not be found
WrongNodeTypeException - Thrown if the given node is not of type user
Method Detail

getType

public java.lang.String getType()

getDate

public java.util.Date getDate()

getBeer

public BeerModel getBeer()

getUser

public UserModel getUser()

getSecondsAgo

public long getSecondsAgo()
Returns:
number of seconds ago the action was created.