Class DefaultOpticalDevice

  • All Implemented Interfaces:
    org.onosproject.net.Annotated, org.onosproject.net.Device, org.onosproject.net.driver.Behaviour, org.onosproject.net.driver.Projectable, org.onosproject.net.Element, OpticalDevice, org.onosproject.net.Provided, org.onosproject.net.utils.ForwardingDevice

    @Beta
    public class DefaultOpticalDevice
    extends org.onosproject.net.driver.AbstractBehaviour
    implements OpticalDevice, org.onosproject.net.utils.ForwardingDevice
    Implementation of OpticalDevice.

    Currently supports

    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.onosproject.net.Device

        org.onosproject.net.Device.Type
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.onosproject.net.Device delegate()  
      boolean equals​(java.lang.Object obj)  
      int hashCode()  
      org.onosproject.net.Port port​(org.onosproject.net.Port port)
      Returns most specific projection of the port or the port itself.
      <T extends org.onosproject.net.Port>
      java.util.Optional<T>
      portAs​(org.onosproject.net.Port port, java.lang.Class<T> portClass)
      Returns the specified projection of the port if such projection is supported.
      <T extends org.onosproject.net.Port>
      boolean
      portIs​(org.onosproject.net.Port port, java.lang.Class<T> portClass)
      Returns true if port is capable of being projected as the specified class.
      java.lang.String toString()  
      • Methods inherited from class org.onosproject.net.driver.AbstractBehaviour

        data, setData
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.onosproject.net.driver.Behaviour

        data, setData
      • Methods inherited from interface org.onosproject.net.utils.ForwardingDevice

        annotations, as, chassisId, hwVersion, id, is, manufacturer, providerId, serialNumber, swVersion, type
      • Methods inherited from interface org.onosproject.net.driver.Projectable

        project
    • Constructor Detail

      • DefaultOpticalDevice

        public DefaultOpticalDevice()
    • Method Detail

      • delegate

        public org.onosproject.net.Device delegate()
        Specified by:
        delegate in interface org.onosproject.net.utils.ForwardingDevice
      • portIs

        public <T extends org.onosproject.net.Port> boolean portIs​(org.onosproject.net.Port port,
                                                                   java.lang.Class<T> portClass)
        Description copied from interface: OpticalDevice
        Returns true if port is capable of being projected as the specified class.
        Specified by:
        portIs in interface OpticalDevice
        Type Parameters:
        T - type of Port
        Parameters:
        port - Port instance to test
        portClass - requested projection class
        Returns:
        true if the requested projection is supported
      • portAs

        public <T extends org.onosproject.net.Port> java.util.Optional<T> portAs​(org.onosproject.net.Port port,
                                                                                 java.lang.Class<T> portClass)
        Description copied from interface: OpticalDevice
        Returns the specified projection of the port if such projection is supported.
        Specified by:
        portAs in interface OpticalDevice
        Type Parameters:
        T - type of Port
        Parameters:
        port - Port instance to project
        portClass - requested projection class
        Returns:
        projection instance or empty if not supported.
      • port

        public org.onosproject.net.Port port​(org.onosproject.net.Port port)
        Description copied from interface: OpticalDevice
        Returns most specific projection of the port or the port itself.
        Specified by:
        port in interface OpticalDevice
        Parameters:
        port - Port instance
        Returns:
        projection instance or port itself
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object