Class AbstractPortMapper<P extends org.onosproject.net.Port>
- java.lang.Object
-
- org.onosproject.net.optical.device.port.AbstractPortMapper<P>
-
- All Implemented Interfaces:
PortMapper<P>
- Direct Known Subclasses:
OchPortMapper,OduCltPortMapper,OmsPortMapper,OtuPortMapper
@Beta public abstract class AbstractPortMapper<P extends org.onosproject.net.Port> extends java.lang.Object implements PortMapper<P>
PortMapper which caches mapped Port instance.
-
-
Constructor Summary
Constructors Constructor Description AbstractPortMapper()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.util.Optional<P>as(org.onosproject.net.Port port)Returnsportmapped to<P>.booleanis(org.onosproject.net.Port port)Returns true if this port is capable of being projected as<P>.protected abstract java.util.Optional<P>mapPort(org.onosproject.net.Port port)Returnsportmapped to<P>.
-
-
-
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:
isin interfacePortMapper<P extends org.onosproject.net.Port>- Parameters:
port- port- Returns:
- true if this port can be projected as the given type
-
as
public java.util.Optional<P> as(org.onosproject.net.Port port)
Returnsportmapped to<P>.Note: Subclasses should override and check if
portis already of typePand directly returnOptional.of((P) port), if not callsuper.as(port).- Specified by:
asin interfacePortMapper<P extends org.onosproject.net.Port>- Parameters:
port- Port to map- Returns:
portmapped to<P>
-
mapPort
protected abstract java.util.Optional<P> mapPort(org.onosproject.net.Port port)
Returnsportmapped to<P>.- Parameters:
port- Port to map- Returns:
portmapped to<P>
-
-