Class AbstractPortMapper<P extends org.onosproject.net.Port>

    • Constructor Detail

      • AbstractPortMapper

        public AbstractPortMapper()
    • Method Detail

      • is

        public boolean is​(org.onosproject.net.Port port)
        Returns true if this port is capable of being projected as <P>.

        Note: Subclasses should override and implement short-cut conditions and call super.is(port).

        Specified by:
        is in interface PortMapper<P extends org.onosproject.net.Port>
        Parameters:
        port - port
        Returns:
        true if this port can be projected as the given type
      • as

        public Optional<P> as​(org.onosproject.net.Port port)
        Returns port mapped to <P>.

        Note: Subclasses should override and check if port is already of type P and directly return Optional.of((P) port), if not call super.as(port).

        Specified by:
        as in interface PortMapper<P extends org.onosproject.net.Port>
        Parameters:
        port - Port to map
        Returns:
        port mapped to <P>
      • mapPort

        protected abstract Optional<P> mapPort​(org.onosproject.net.Port port)
        Returns port mapped to <P>.
        Parameters:
        port - Port to map
        Returns:
        port mapped to <P>