Class UserNotification

  • Direct Known Subclasses:
    UserNotificationWithFeedback

    @Immutable
    public class UserNotification
    extends java.lang.Object
    Author:
    Fabrizio Giudici
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String caption  
      protected java.lang.String text  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static UserNotification notification()
      Creates a notification with empty caption and text.
      UserNotification withCaption​(java.lang.Class<?> bundleClass, java.lang.String resourceName, java.lang.Object... params)
      Associates a caption to the notification, retrieved from a resource bundle.
      UserNotification withCaption​(java.lang.String caption)
      Associates a caption to the notification.
      UserNotification withText​(java.lang.Class<?> bundleClass, java.lang.String resourceName, java.lang.Object... params)
      Associates a text to the notification, retrieved from a resource bundle.
      UserNotification withText​(java.lang.String text)
      Associates a text to the notification.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • text

        protected final java.lang.String text
      • caption

        protected final java.lang.String caption
    • Constructor Detail

      • UserNotification

        public UserNotification()
    • Method Detail

      • notification

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

        @Nonnull
        public UserNotification withCaption​(@Nonnull
                                            java.lang.String caption)
        Associates a caption to the notification.
        Parameters:
        caption - the caption
        Returns:
        the notification
      • withCaption

        @Nonnull
        public UserNotification withCaption​(@Nonnull
                                            java.lang.Class<?> bundleClass,
                                            @Nonnull
                                            java.lang.String resourceName,
                                            @Nonnull
                                            java.lang.Object... params)
        Associates a caption to the notification, retrieved from a resource 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:
        the notification
      • withText

        @Nonnull
        public UserNotification withText​(@Nonnull
                                         java.lang.String text)
        Associates a text to the notification.
        Parameters:
        text - the text
        Returns:
        the notification
      • withText

        @Nonnull
        public UserNotification withText​(@Nonnull
                                         java.lang.Class<?> bundleClass,
                                         @Nonnull
                                         java.lang.String resourceName,
                                         @Nonnull
                                         java.lang.Object... params)
        Associates a text to the notification, retrieved from a resource 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:
        the notification