Package jmri

Interface SystemConnectionMemo

    • Method Detail

      • get

        @OverridingMethodsMustInvokeSuper
        <T> T get​(java.lang.Class<T> type)
        Get a manager for a specific type. This method must return a non-null value if provides(java.lang.Class) is true for the type, and must return null if provides() is false for the type.
        Type Parameters:
        T - Type of manager to get
        Parameters:
        type - Type of manager to get
        Returns:
        The manager or null if provides() is false for T
        See Also:
        provides(java.lang.Class)
      • getDisabled

        boolean getDisabled()
        Get if the System Connection is currently Disabled.
        Returns:
        true if Disabled, else false.
      • getNamedBeanComparator

        <B extends NamedBean> java.util.Comparator<B> getNamedBeanComparator​(java.lang.Class<B> type)
        Get the Comparator to be used for two NamedBeans. This is typically an NamedBeanComparator, but may be any Comparator that works for this connection type.
        Type Parameters:
        B - the type of NamedBean
        Parameters:
        type - the class of NamedBean
        Returns:
        the Comparator
      • getSystemPrefix

        java.lang.String getSystemPrefix()
        Provide access to the system prefix string.

        This was previously called the "System letter".

        Returns:
        System prefix
      • getUserName

        java.lang.String getUserName()
        Provide access to the system user name string.

        This was previously fixed at configuration time.

        Returns:
        User name of the connection
      • isDirty

        boolean isDirty()
        Get if connection is dirty. Checked fields are disabled, prefix, userName
        Returns:
        true if changed since loaded
      • provides

        @OverridingMethodsMustInvokeSuper
        boolean provides​(java.lang.Class<?> c)
        Check if this connection provides a specific manager type. This method must return false if a manager for the specific type is not provided, and must return true if a manager for the specific type is provided.
        Parameters:
        c - The class type for the manager to be provided
        Returns:
        true if the specified manager is provided
        See Also:
        get(java.lang.Class)
      • register

        void register()
        Store in InstanceManager with proper ID for later retrieval as a generic system.
      • setDisabled

        void setDisabled​(boolean disabled)
        Set if the System Connection is currently Disabled.

        disabledAsLoaded is only set once. Sends PropertyChange on change of disabled status.

        Parameters:
        disabled - true to disable, false to enable.
      • setSystemPrefix

        boolean setSystemPrefix​(@Nonnull
                                java.lang.String systemPrefix)
        Set the system prefix.
        Parameters:
        systemPrefix - prefix to use for this system connection
        Returns:
        true if the system prefix could be set
        Throws:
        java.lang.NullPointerException - if systemPrefix is null
      • setUserName

        boolean setUserName​(@Nonnull
                            java.lang.String userName)
        Set the user name for the system connection.
        Parameters:
        userName - user name to use for this system connection
        Returns:
        true if the user name could be set
        Throws:
        java.lang.NullPointerException - if name is null
      • getDefaultOutputInterval

        int getDefaultOutputInterval()
        Get the Default connection specific OutputInterval to wait between/before commands are sent.
        Returns:
        the default output interval time in ms.