java.lang.Object
de.stklcode.pubtrans.ura.model.Message
All Implemented Interfaces:
java.io.Serializable

public class Message
extends java.lang.Object
Entity for a message.
Since:
1.3
Author:
Stefan Kalscheuer
See Also:
Serialized Form
  • Constructor Summary

    Constructors
    Constructor Description
    Message​(Stop stop, java.lang.String msgUUID, java.lang.Integer msgType, java.lang.Integer msgPriority, java.lang.String msgText)
    Construct Message object from Stop model and set of additional data.
    Message​(java.lang.String stopID, java.lang.String stopName, java.lang.String stopIndicator, java.lang.Integer stopState, java.lang.Double stopLatitude, java.lang.Double stopLongitude, java.lang.String msgUUID, java.lang.Integer msgType, java.lang.Integer msgPriority, java.lang.String msgText)
    Construct Message object from complete set of data.
    Message​(java.util.List<java.io.Serializable> raw)
    Construct Message object from raw list of attributes parsed from JSON.
    Message​(java.util.List<java.io.Serializable> raw, java.lang.String version)
    Construct Message object from raw list of attributes parsed from JSON with explicitly specified version.
  • Method Summary

    Modifier and Type Method Description
    java.lang.Integer getPriority()
    Messages are assigned a priority in order for them to be ranked.
    Stop getStop()
    The stop, the message is targeted.
    java.lang.String getText()
    The text of the message.
    java.lang.Integer getType()
    Messages are assigned a type.
    java.lang.String getUuid()
    This is the unique identifier of the flexible message.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Message

      public Message​(java.lang.String stopID, java.lang.String stopName, java.lang.String stopIndicator, java.lang.Integer stopState, java.lang.Double stopLatitude, java.lang.Double stopLongitude, java.lang.String msgUUID, java.lang.Integer msgType, java.lang.Integer msgPriority, java.lang.String msgText)
      Construct Message object from complete set of data.
      Parameters:
      stopID - Stop ID.
      stopName - Stop name.
      stopIndicator - Stop Indicator.
      stopState - Stop state.
      stopLatitude - Stop geolocation latitude.
      stopLongitude - Stop geolocation latitude.
      msgUUID - Message UUID.
      msgType - Message type.
      msgPriority - Message priority.
      msgText - Message text.
    • Message

      public Message​(Stop stop, java.lang.String msgUUID, java.lang.Integer msgType, java.lang.Integer msgPriority, java.lang.String msgText)
      Construct Message object from Stop model and set of additional data.
      Parameters:
      stop - Stop model
      msgUUID - Message UUID.
      msgType - Message type.
      msgPriority - Message priority.
      msgText - Message text.
    • Message

      public Message​(java.util.List<java.io.Serializable> raw) throws java.io.IOException
      Construct Message object from raw list of attributes parsed from JSON.
      Parameters:
      raw - List of attributes from JSON line
      Throws:
      java.io.IOException - Thrown on invalid line format.
    • Message

      public Message​(java.util.List<java.io.Serializable> raw, java.lang.String version) throws java.io.IOException
      Construct Message object from raw list of attributes parsed from JSON with explicitly specified version.
      Parameters:
      raw - List of attributes from JSON line
      version - API version
      Throws:
      java.io.IOException - Thrown on invalid line format.
  • Method Details

    • getStop

      public Stop getStop()
      The stop, the message is targeted.
      Returns:
      The affected stop.
    • getUuid

      public java.lang.String getUuid()
      This is the unique identifier of the flexible message.
      Returns:
      Message's unique identifier.
    • getType

      public java.lang.Integer getType()
      Messages are assigned a type. This is predominantly in order to define how they should be displayed on on-street signs, however can be used to alter display on other devices.
      • 0: “Normal”
      • 1: “Special”
      • 2: “Full Matrix” – Stop is temporarily out of service and predictions should not be presented
      Returns:
      Message type.
    • getPriority

      public java.lang.Integer getPriority()
      Messages are assigned a priority in order for them to be ranked. Since it is possible for a stop to be assigned multiple messages it is important to ensure priority is given. Priorities are between 1 and 10 (where 1 is the highest priority). By default the message priority is set to 3.
      Returns:
      Message priority.
    • getText

      public java.lang.String getText()
      The text of the message. This should be displayed to the public.
      Returns:
      Message text.