Package org.apache.tapestry5.alerts

# Class Alert

java.lang.Object
org.apache.tapestry5.alerts.Alert

All Implemented Interfaces:
  `Serializable`

public class Alert extends Object implements Serializable
An Alert that may be presented to the user. The Alert has a message, but also includes a severity (that controls how it is presented to the user), and a duration (that controls how long it is presented to the user). If the `markup` field is `true`, the message is treated as HTML and used without any escaping.

Since:
  5.3
See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `final Duration`
  `duration`
  `final long`
  `id`
  A unique id (unique within this JVM and execution), used to identify an alert (used primarily when individually dismissing an alert).
  `final boolean`
  `markup`
  Defines whether the message will be treated as HTML or not.
  `final String`
  `message`
  `final Severity`
  `severity`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Alert(String message)`
  Alert with default duration of `Duration.SINGLE` and default severity of `Severity.INFO`.
  `Alert(Duration duration, Severity severity, String message)`
  `Alert(Duration duration, Severity severity, String message, boolean markup)`
  `Alert(Severity severity, String message)`
  Alert with default duration of `Duration.SINGLE`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `JSONObject`
  `toJSON()`
  `String`
  `toString()`

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

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

- ## Field Details

  - ### id

    public final long id
    A unique id (unique within this JVM and execution), used to identify an alert (used primarily when individually dismissing an alert).

  - ### duration

    public final Duration duration

  - ### severity

    public final Severity severity

  - ### message

    public final String message

  - ### markup

    public final boolean markup
    Defines whether the message will be treated as HTML or not.
    Since:
      5.4

- ## Constructor Details

  - ### Alert

    public Alert(String message)
    Alert with default duration of `Duration.SINGLE` and default severity of `Severity.INFO`.

  - ### Alert

    public Alert(Severity severity, String message)
    Alert with default duration of `Duration.SINGLE`.

  - ### Alert

    public Alert(Duration duration, Severity severity, String message)

  - ### Alert

    public Alert(Duration duration, Severity severity, String message, boolean markup)

- ## Method Details

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### toJSON

    public JSONObject toJSON()