Package org.onosproject.net.driver
Interface Projectable
-
- All Known Subinterfaces:
Device
,DisjointPath
,EdgeLink
,Element
,ForwardingDevice
,Host
,HostProbe
,Link
,Path
- All Known Implementing Classes:
AbstractElement
,AbstractProjectableModel
,DefaultDevice
,DefaultDisjointPath
,DefaultEdgeLink
,DefaultHost
,DefaultLink
,DefaultPath
@Beta public interface Projectable
Abstraction of an entity capable of being projected as another entity.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description <B extends Behaviour>
Bas(java.lang.Class<B> projectionClass)
Returns the specified projection of this entity if such projection is supported.<B extends Behaviour>
booleanis(java.lang.Class<B> projectionClass)
Returns true if this entity is capable of being projected as the specified class.default <B extends Behaviour>
java.util.Optional<B>project(java.lang.Class<B> projectionClass)
Returns the specified projection of this entity if such projection is supported.
-
-
-
Method Detail
-
as
<B extends Behaviour> B as(java.lang.Class<B> projectionClass)
Returns the specified projection of this entity if such projection is supported.- Type Parameters:
B
- type of behaviour- Parameters:
projectionClass
- requested projection class- Returns:
- projection instance
- Throws:
java.lang.IllegalStateException
- if a driver cannot be foundjava.lang.IllegalArgumentException
- if the projection is not supported
-
is
<B extends Behaviour> boolean is(java.lang.Class<B> projectionClass)
Returns true if this entity is capable of being projected as the specified class.- Type Parameters:
B
- type of behaviour- Parameters:
projectionClass
- requested projection class- Returns:
- true if the requested projection is supported
-
project
default <B extends Behaviour> java.util.Optional<B> project(java.lang.Class<B> projectionClass)
Returns the specified projection of this entity if such projection is supported.- Type Parameters:
B
- type of behaviour- Parameters:
projectionClass
- requested projection class- Returns:
- projection instance
-
-