@Beta public abstract class AbstractPortMapper<P extends org.onosproject.net.Port> extends Object implements PortMapper<P>
| Constructor and Description |
|---|
AbstractPortMapper() |
| Modifier and Type | Method and Description |
|---|---|
Optional<P> |
as(org.onosproject.net.Port port)
Returns
port mapped to {@code |
boolean |
is(org.onosproject.net.Port port)
Returns true if this port is capable of being projected as {@code
|
protected abstract Optional<P> |
mapPort(org.onosproject.net.Port port)
Returns
port mapped to {@code |
public boolean is(org.onosproject.net.Port port)
<P>.
Note: Subclasses should override and implement short-cut conditions
and call super.is(port).
is in interface PortMapper<P extends org.onosproject.net.Port>port - portpublic Optional<P> as(org.onosproject.net.Port port)
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).
as in interface PortMapper<P extends org.onosproject.net.Port>port - Port to mapport mapped to <P>