de.novanic.eventservice.client.event
Class DefaultDomainEvent

java.lang.Object
  extended by de.novanic.eventservice.client.event.DefaultDomainEvent
All Implemented Interfaces:
DomainEvent, java.io.Serializable, java.lang.Comparable<DomainEvent>

public class DefaultDomainEvent
extends java.lang.Object
implements DomainEvent, java.lang.Comparable<DomainEvent>

A DomainEvent is a container and contains an event and the domain where the event has occurred.

Author:
sstrohschein
Date: 05.08.2008
Time: 17:25:12
See Also:
Serialized Form

Constructor Summary
DefaultDomainEvent()
          Deprecated. That constructor is only for serialization! Please use DefaultDomainEvent(Event) or DefaultDomainEvent(Event, de.novanic.eventservice.client.event.domain.Domain) instead.
DefaultDomainEvent(Event aEvent)
          Creates a new DomainEvent without a domain.
DefaultDomainEvent(Event aEvent, Domain aDomain)
          Creates a new DomainEvent with an event and a domain.
 
Method Summary
 int compareTo(DomainEvent aDomainEvent)
           
 boolean equals(java.lang.Object anObject)
           
 Domain getDomain()
          Returns the domain where the event has occurred.
 Event getEvent()
          Returns the event.
 int hashCode()
           
 boolean isUserSpecific()
          An event/DomainEvent is user specific when it is only for one user and not for the complete domain.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultDomainEvent

@Deprecated
public DefaultDomainEvent()
Deprecated. That constructor is only for serialization! Please use DefaultDomainEvent(Event) or DefaultDomainEvent(Event, de.novanic.eventservice.client.event.domain.Domain) instead.

See Also:
DefaultDomainEvent(Event), DefaultDomainEvent(Event, de.novanic.eventservice.client.event.domain.Domain)

DefaultDomainEvent

public DefaultDomainEvent(Event aEvent,
                          Domain aDomain)
Creates a new DomainEvent with an event and a domain.

Parameters:
aEvent - event
aDomain - domain where the event has occurred

DefaultDomainEvent

public DefaultDomainEvent(Event aEvent)
Creates a new DomainEvent without a domain. This can be used when the event is user specific. When the event has occurred for a domain, the constructor DefaultDomainEvent(Event, Domain) should be used.

Parameters:
aEvent - event
Method Detail

isUserSpecific

public boolean isUserSpecific()
An event/DomainEvent is user specific when it is only for one user and not for the complete domain. This flag depends on the constructor. If the DomainEvent is created with a domain, the DomainEvent isn't user specific.

Specified by:
isUserSpecific in interface DomainEvent
Returns:
true when the event is user specific, otherwise false

getEvent

public Event getEvent()
Returns the event.

Specified by:
getEvent in interface DomainEvent
Returns:
event

getDomain

public Domain getDomain()
Returns the domain where the event has occurred.

Specified by:
getDomain in interface DomainEvent
Returns:
domain

compareTo

public int compareTo(DomainEvent aDomainEvent)
Specified by:
compareTo in interface java.lang.Comparable<DomainEvent>

equals

public boolean equals(java.lang.Object anObject)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

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