Class BiLink

  • Direct Known Subclasses:
    BaseLink

    public abstract class BiLink
    extends java.lang.Object
    Representation of a link and its inverse, as a partial implementation.

    Subclasses will decide how to generate the link highlighting (coloring and labeling) for the topology view.

    As an alternative, a bi-link can be initialized with a UiLinkId (ignoring the LinkKey and links one and two), which will be reported as its identifier instead.

    • Constructor Summary

      Constructors 
      Constructor Description
      BiLink​(LinkKey key, Link link)
      Constructs a bi-link for the given key and initial link.
      BiLink​(UiLinkId uilinkId)
      Constructs a bi-link for the given UI link identifier; sets remaining fields to null.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract LinkHighlight highlight​(java.lang.Enum<?> type)
      Returns the link highlighting to use, based on this bi-link's current state.
      LinkKey key()
      Returns the key for this bi-link.
      java.lang.String linkId()
      Returns the link identifier in the form expected on the Topology View in the web client.
      Link one()
      Returns the first link in this bi-link.
      void setOther​(Link link)
      Sets the second link for this bi-link.
      java.lang.String toString()  
      Link two()
      Returns the second link in this bi-link.
      UiLinkId uiLinkId()
      Returns the UI link identifier for this bi-link (if set).
      • Methods inherited from class java.lang.Object

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

      • BiLink

        public BiLink​(LinkKey key,
                      Link link)
        Constructs a bi-link for the given key and initial link. It is expected that the caller will have used TopoUtils.canonicalLinkKey(Link) to generate the key.
        Parameters:
        key - canonical key for this bi-link
        link - first link
      • BiLink

        public BiLink​(UiLinkId uilinkId)
        Constructs a bi-link for the given UI link identifier; sets remaining fields to null.
        Parameters:
        uilinkId - canonical ID for this bi-link
    • Method Detail

      • setOther

        public void setOther​(Link link)
        Sets the second link for this bi-link.
        Parameters:
        link - second link
      • linkId

        public java.lang.String linkId()
        Returns the link identifier in the form expected on the Topology View in the web client.
        Returns:
        link identifier
      • uiLinkId

        public UiLinkId uiLinkId()
        Returns the UI link identifier for this bi-link (if set).
        Returns:
        the UI link ID
      • key

        public LinkKey key()
        Returns the key for this bi-link.
        Returns:
        the key
      • one

        public Link one()
        Returns the first link in this bi-link.
        Returns:
        the first link
      • two

        public Link two()
        Returns the second link in this bi-link.
        Returns:
        the second link
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • highlight

        public abstract LinkHighlight highlight​(java.lang.Enum<?> type)
        Returns the link highlighting to use, based on this bi-link's current state.
        Parameters:
        type - optional highlighting type parameter
        Returns:
        link highlighting model