Class UserNotification

java.lang.Object
it.tidalwave.ui.core.UserNotification
Direct Known Subclasses:
UserNotificationWithFeedback

@Immutable public class UserNotification extends Object
This class models a notification that will be presented to a user, without a feedback.
Since:
2.0-ALPHA-2
Author:
Fabrizio Giudici
  • Field Details

    • text

      @Nonnull protected final String text
    • caption

      @Nonnull protected final String caption
  • Constructor Details

    • UserNotification

      public UserNotification()
  • Method Details

    • notification

      @Nonnull public static UserNotification notification()
      Returns a notification with empty caption and text..
      Returns:
      a notification with empty caption and text
    • withCaption

      @Nonnull public UserNotification withCaption(@Nonnull String caption)
      Returns a notification with a caption..
      Parameters:
      caption - the caption
      Returns:
      a notification with a caption
    • withCaption

      @Nonnull public UserNotification withCaption(@Nonnull Class<?> bundleClass, @Nonnull String resourceName, @Nonnull Object... params)
      Returns a notification with a caption from a bundle..
      Parameters:
      bundleClass - the class where to search the resource bundle from
      resourceName - the resource name of the caption in the bundle
      params - some (optional) parameters to the resource
      Returns:
      a notification with a caption from a bundle
    • withText

      @Nonnull public UserNotification withText(@Nonnull String text)
      Returns a notification with a text..
      Parameters:
      text - the text
      Returns:
      a notification with a text
    • withText

      @Nonnull public UserNotification withText(@Nonnull Class<?> bundleClass, @Nonnull String resourceName, @Nonnull Object... params)
      Returns a notification with a text from a bundle..
      Parameters:
      bundleClass - the class where to search the resource bundle from
      resourceName - the resource name of the text in the bundle
      params - some (optional) parameters to the resource
      Returns:
      a notification with a text from a bundle