com.thinkaurelius.titan.diskstorage.log.util

## Class AbstractMessage

- java.lang.Object
- - com.thinkaurelius.titan.diskstorage.log.util.AbstractMessage

- All Implemented Interfaces:
    Message
  Direct Known Subclasses:
    KCVSMessage

      public abstract class AbstractMessage
      extends Object
      implements Message

  Abstract implementation of `Message` which exposes the timestamp, sender, and payload of a message. Particular `Log` implementations can extend this class.
  Author:
    Matthias Broecheler (me@matthiasb.com)

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `AbstractMessage(StaticBuffer content, Timepoint timestamp, String senderId)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object other)`
    `StaticBuffer` | `getContent()` Returns the content of the message
    `String` | `getSenderId()` Returns the unique identifier for the sender of the message
    `long` | `getTimestamp(TimeUnit unit)` Returns the timestamp of this message in the specified time unit.
    `Timepoint` | `getTimestampMicro()`
    `int` | `hashCode()`
    `String` | `toString()`

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

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

- - ### Constructor Detail

    - #### AbstractMessage

          protected AbstractMessage(StaticBuffer content,
                         Timepoint timestamp,
                         String senderId)

  - ### Method Detail

    - #### getSenderId

          public String getSenderId()

      Description copied from interface: `Message`
      Returns the unique identifier for the sender of the message
      Specified by:
        `getSenderId` in interface `Message`
      Returns:

    - #### getTimestampMicro

          public Timepoint getTimestampMicro()

    - #### getTimestamp

          public long getTimestamp(TimeUnit unit)

      Description copied from interface: `Message`
      Returns the timestamp of this message in the specified time unit. This is the time when the message was added to the log.
      Specified by:
        `getTimestamp` in interface `Message`
      Returns:

    - #### getContent

          public StaticBuffer getContent()

      Description copied from interface: `Message`
      Returns the content of the message
      Specified by:
        `getContent` in interface `Message`
      Returns:

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object other)

      Overrides:
        `equals` in class `Object`

Copyright © 2012–2014. All rights reserved.