edu.cmu.pslc.logging

## Class ToolMessage

- java.lang.Object
- - edu.cmu.pslc.logging.Message
  - - edu.cmu.pslc.logging.ToolMessage

-     public final class ToolMessage
      extends Message

  The tutor message represents a logging element that originates from the tutor.
  Version:
    $Revision: 9303 $
    Last modified by: $Author: mkomisin $
    Last modified on: $Date: 2013-05-30 11:30:09 -0400 (Thu, 30 May 2013) $
  Author:
    Alida Skogsholm

- - ### Field Summary

    - ### Fields inherited from class edu.cmu.pslc.logging.Message

      `ATTEMPT, CONTEXT_MSG_ELEMENT, CURRICULUM_MSG_ELEMENT, HINT_MESSAGE, HINT_REQUEST, MSG_ELEMENT, MSG_SEQUENCE_ELEMENT, RESULT, TOOL_MSG_ELEMENT, TUTOR_MSG_ELEMENT, VERSION_NUMBER, VERSION_NUMBER_ATTR`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addAction(java.lang.String action)` Add action to event descriptor element.
    `void` | `addCustomField(CustomFieldElement customFieldElement)` Add custom field given the custom field element.
    `void` | `addCustomField(java.lang.String name, java.lang.String value)` Add custom field given the name and value.
    `void` | `addInput(java.lang.String input)` Add input to event descriptor element.
    `void` | `addSai(java.lang.String selection, java.lang.String action, java.lang.String input)` Add selection, action, and input.
    `void` | `addSelection(java.lang.String selection)` Add selection to event descriptor element.
    `static ToolMessage` | `create(ContextMessage contextMessage)` Creates a new tool message given a context message.
    `java.util.List` | `getCustomFieldList()` Get custom field list.
    `EventDescriptorElement` | `getEventDescriptorElement()` Get event descriptor element.
    `EventElement` | `getEventElement()` Get event element.
    `java.lang.String` | `getProblemName()` Get problem name.
    `java.lang.String` | `getReplayText()` Get replay text.
    `void` | `setAsAttempt()` Set event as an attempt event.
    `void` | `setAsAttempt(java.lang.String subtype)` Set event as an attempt event given the subtype.
    `void` | `setAsHintRequest()` Set event as hint request.
    `void` | `setAsHintRequest(java.lang.String subtype)` Set event as hint request given the subtype.
    `void` | `setEventElement(EventElement eventElement)` Set event element.
    `void` | `setProblemName(java.lang.String problemName)` Set problem name.
    `void` | `setReplayElement(java.lang.String replayText)` Set replay text.
    `void` | `setTransactionId(java.lang.String id)` Set transaction id.
    `java.lang.String` | `toString()` To string method calls toString(boolean).
    `java.lang.String` | `toString(boolean logMetaFlag)` To string method.

    - ### Methods inherited from class edu.cmu.pslc.logging.Message

      `generateGUID, getContextMessageId, getMetaElement, getSessionId, getSource, getTimeString, getTimeZone, getUserId, setContextMessageId, setSource, setTimeString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Method Detail

    - #### create

          public static ToolMessage create(ContextMessage contextMessage)

      Creates a new tool message given a context message.
      Parameters:
        `contextMessage` - the context message
      Returns:
        the new tool message

    - #### getProblemName

          public java.lang.String getProblemName()

      Get problem name.
      Returns:
        the problem name

    - #### setProblemName

          public void setProblemName(java.lang.String problemName)

      Set problem name.
      Parameters:
        `problemName` - the problem name

    - #### getEventElement

          public EventElement getEventElement()

      Get event element.
      Returns:
        the event element

    - #### setEventElement

          public void setEventElement(EventElement eventElement)

      Set event element.
      Parameters:
        `eventElement` - the event element

    - #### setAsAttempt

          public void setAsAttempt()

      Set event as an attempt event.

    - #### setAsAttempt

          public void setAsAttempt(java.lang.String subtype)

      Set event as an attempt event given the subtype.
      Parameters:
        `subtype` - a subtype

    - #### setAsHintRequest

          public void setAsHintRequest()

      Set event as hint request.

    - #### setAsHintRequest

          public void setAsHintRequest(java.lang.String subtype)

      Set event as hint request given the subtype.
      Parameters:
        `subtype` - the subtype

    - #### getEventDescriptorElement

          public EventDescriptorElement getEventDescriptorElement()

      Get event descriptor element.
      Returns:
        the event descriptor element

    - #### addSai

          public void addSai(java.lang.String selection,
                    java.lang.String action,
                    java.lang.String input)

      Add selection, action, and input.
      Parameters:
        `selection` - the selection
        `action` - the action
        `input` - the input

    - #### addSelection

          public void addSelection(java.lang.String selection)

      Add selection to event descriptor element.
      Parameters:
        `selection` - the selection

    - #### addAction

          public void addAction(java.lang.String action)

      Add action to event descriptor element.
      Parameters:
        `action` - the action

    - #### addInput

          public void addInput(java.lang.String input)

      Add input to event descriptor element.
      Parameters:
        `input` - the input

    - #### getCustomFieldList

          public java.util.List getCustomFieldList()

      Get custom field list.
      Returns:
        the custom field list

    - #### addCustomField

          public void addCustomField(java.lang.String name,
                            java.lang.String value)

      Add custom field given the name and value.
      Parameters:
        `name` - the name
        `value` - the value

    - #### addCustomField

          public void addCustomField(CustomFieldElement customFieldElement)

      Add custom field given the custom field element.
      Parameters:
        `customFieldElement` - the custom field element

    - #### setTransactionId

          public void setTransactionId(java.lang.String id)

      Set transaction id.
      Parameters:
        `id` - the transaction id

    - #### getReplayText

          public java.lang.String getReplayText()

      Get replay text.
      Returns:
        the replay text

    - #### setReplayElement

          public void setReplayElement(java.lang.String replayText)

      Set replay text.
      Parameters:
        `replayText` - the replay text

    - #### toString

          public java.lang.String toString()

      To string method calls toString(boolean).
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        the string to display

    - #### toString

          public java.lang.String toString(boolean logMetaFlag)

      To string method.
      Specified by:
        `toString` in class `Message`
      Parameters:
        `logMetaFlag` - whether to display the meta element
      Returns:
        the string to display

Copyright (c) 2015 - Pittsburgh Science of Learning Center