Class BiLink

  • Direct Known Subclasses:
    BaseLink

    public abstract class BiLink
    extends 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 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 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
      • highlight

        public abstract LinkHighlight highlight​(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