Package jmri

Class NamedBean.DuplicateSystemNameException

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getLocalizedMessage()  
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

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

      • DuplicateSystemNameException

        public DuplicateSystemNameException()
        Create an exception with no message to the user or for logging. Use only when calling methods likely have alternate mechanism for allowing user to understand why exception was thrown.
      • DuplicateSystemNameException

        public DuplicateSystemNameException​(java.lang.String message)
        Create a exception.
        Parameters:
        message - bundle key to be translated
      • DuplicateSystemNameException

        public DuplicateSystemNameException​(java.util.Locale locale,
                                            java.lang.String message,
                                            java.lang.Object... subs)
        Create a localized exception, suitable for display to the user. This takes the same arguments as Bundle.getMessage(java.util.Locale, java.lang.String, java.lang.Object...) as it uses that method to create both the localized and loggable messages.

        Use getLocalizedMessage() to display the message to the user, and use Throwable.getMessage() to record the message in logs.

        Note the message must be accessible by Bundle.

        Parameters:
        locale - the locale to be used
        message - bundle key to be translated
        subs - One or more objects to be inserted into the message
      • DuplicateSystemNameException

        public DuplicateSystemNameException​(java.lang.String logging,
                                            java.lang.String display)
        Create a localized exception, suitable for display to the user. This takes the non-localized message followed by the localized message.

        Use getLocalizedMessage() to display the message to the user, and use Throwable.getMessage() to record the message in logs.

        Parameters:
        logging - the English message for logging
        display - the localized message for display
    • Method Detail

      • getLocalizedMessage

        public java.lang.String getLocalizedMessage()
        Overrides:
        getLocalizedMessage in class java.lang.Throwable