Clearspace API (1.3.0) Core Javadocs

com.jivesoftware.community.event
Class QuestionEvent

java.lang.Object
  extended by com.jivesoftware.community.event.QuestionEvent
All Implemented Interfaces:
JiveEvent

public class QuestionEvent
extends java.lang.Object
implements JiveEvent

A class for Question events. This class will be passed to QuestionListeners whenever a question event is fired and contains all the pertinent information to the event. Certain event types will populate the params Map with additional objects as outlined below:

Event Type Extra Params
QUESTION_ADDED None
QUESTION_DELETED None
QUESTION_STATE_MODIFIED oldState (Question.State) -- the resolution state that the Question was previously in.
CORRECT_ANSWER_SETmessageID (Long) -- the ID of the Message that was added or removed as a correct answer.
HELPFUL_ANSWER_ADDEDmessageID (Long) -- the ID of the Message that was added or removed as a helpful answer.
PROPERTY_MODIFIEDNone


Field Summary
static int CORRECT_ANSWER_SET
          A correct answer was added to the question.
static int HELPFUL_ANSWER_ADDED
          A helpful answer was added to the question.
static int PROPERTY_MODIFIED
          An extended property of the question was added, deleted, or updated.
static int QUESTION_ADDED
          Question was added to the system.
static int QUESTION_DELETED
          Question was deleted.
static int QUESTION_STATE_MODIFIED
          The question resolution state was modified.
 
Constructor Summary
QuestionEvent(int eventType, Question question, java.util.Map<java.lang.String,? extends java.lang.Object> params)
          Creates a new question event.
 
Method Summary
 java.util.Date getDate()
          Returns the date (as a Date object) that the event was created.
 int getEventType()
          Returns the event type corresponding to the event.
 java.util.Map<java.lang.String,? extends java.lang.Object> getParams()
          Returns a map of parameters which can be used to pass data to a listener.
 Question getQuestion()
          Returns the Question that the event corresponds to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

QUESTION_ADDED

public static final int QUESTION_ADDED
Question was added to the system.

See Also:
Constant Field Values

QUESTION_DELETED

public static final int QUESTION_DELETED
Question was deleted.

See Also:
Constant Field Values

QUESTION_STATE_MODIFIED

public static final int QUESTION_STATE_MODIFIED
The question resolution state was modified.

See Also:
Constant Field Values

CORRECT_ANSWER_SET

public static final int CORRECT_ANSWER_SET
A correct answer was added to the question.

See Also:
Constant Field Values

HELPFUL_ANSWER_ADDED

public static final int HELPFUL_ANSWER_ADDED
A helpful answer was added to the question.

See Also:
Constant Field Values

PROPERTY_MODIFIED

public static final int PROPERTY_MODIFIED
An extended property of the question was added, deleted, or updated.

See Also:
Constant Field Values
Constructor Detail

QuestionEvent

public QuestionEvent(int eventType,
                     Question question,
                     java.util.Map<java.lang.String,? extends java.lang.Object> params)
Creates a new question event.

Parameters:
eventType - the type of the question event.
question - the question the event corresponds to.
params - parameters corresponding to the event.
Method Detail

getEventType

public int getEventType()
Description copied from interface: JiveEvent
Returns the event type corresponding to the event.

Specified by:
getEventType in interface JiveEvent
Returns:
the event type corresponding to the event.

getQuestion

public Question getQuestion()
Returns the Question that the event corresponds to.

Returns:
the question the event corresponds to.

getParams

public java.util.Map<java.lang.String,? extends java.lang.Object> getParams()
Description copied from interface: JiveEvent
Returns a map of parameters which can be used to pass data to a listener.

Specified by:
getParams in interface JiveEvent
Returns:
map of parameters which can be used to pass data to a listener.

getDate

public java.util.Date getDate()
Description copied from interface: JiveEvent
Returns the date (as a Date object) that the event was created.

Specified by:
getDate in interface JiveEvent
Returns:
the date (as a Date object) that the event was created.

Clearspace Project Page

Copyright © 1999-2007 Jive Software.