Class UIResponse

  • All Implemented Interfaces:
    UICallback, java.io.Serializable

    public class UIResponse
    extends java.lang.Object
    implements UICallback, java.io.Serializable
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      UIResponse​(java.util.Locale locale)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void attempt​(FragileRunnable<?> method)
      Attempt to run the given method, catching any Throwable and adding it as an error to the UIResponse.
      void error​(java.lang.String message, java.lang.Object... args)  
      java.util.List<java.lang.String> getErrors()  
      java.util.List<java.lang.String> getInfos()  
      java.util.Locale getLocale()  
      java.util.List<java.lang.String> getWarns()  
      void info​(java.lang.String message, java.lang.Object... args)  
      void warn​(java.lang.String message, java.lang.Object... args)  
      static UIResponse wrap​(java.util.Locale locale, java.util.function.Consumer<UIResponse> fx)
      Create a new UIResponse with the given locale, then run the consumer function.
      • Methods inherited from class java.lang.Object

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

      • UIResponse

        public UIResponse​(java.util.Locale locale)
    • Method Detail

      • wrap

        public static UIResponse wrap​(java.util.Locale locale,
                                      java.util.function.Consumer<UIResponse> fx)
        Create a new UIResponse with the given locale, then run the consumer function.
      • attempt

        public void attempt​(FragileRunnable<?> method)
        Attempt to run the given method, catching any Throwable and adding it as an error to the UIResponse.
      • getLocale

        public java.util.Locale getLocale()
        Specified by:
        getLocale in interface UICallback
      • warn

        public void warn​(java.lang.String message,
                         java.lang.Object... args)
        Specified by:
        warn in interface UICallback
      • error

        public void error​(java.lang.String message,
                          java.lang.Object... args)
        Specified by:
        error in interface UICallback
      • info

        public void info​(java.lang.String message,
                         java.lang.Object... args)
        Specified by:
        info in interface UICallback
      • getWarns

        public java.util.List<java.lang.String> getWarns()
      • getErrors

        public java.util.List<java.lang.String> getErrors()
      • getInfos

        public java.util.List<java.lang.String> getInfos()