com.h3c.sdn.region

## Class ControlledEntityModel

- java.lang.Object
- - com.h3c.sdn.region.ControlledEntityModel

- All Implemented Interfaces:
    ControlledEntity, Serializable, Comparable<ControlledEntityModel>

      public class ControlledEntityModel
      extends Object
      implements ControlledEntity, Comparable<ControlledEntityModel>

  Default implementation of ControlledEntity.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ControlledEntityModel(IpAddress ipp)` Creates a Controlled Entity based on just ip Address.
    `ControlledEntityModel(IpAddress ipp, MacAddress mc)` Creates a ControledEntity instance.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareTo(ControlledEntityModel other)`
    `boolean` | `equals(Object obj)`
    `int` | `hashCode()` Depends on the ipAddress hashcode.
    `IpAddress` | `ip()` Returns the ip.
    `MacAddress` | `mac()` Returns the mac.
    `void` | `setIpAddress(IpAddress ipAddress)` Assigns the given ip to this controlled entity.
    `void` | `setMacAddress(MacAddress macAddress)` Assigns the given mac to this controlled entity.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### ControlledEntityModel

          public ControlledEntityModel(IpAddress ipp)

      Creates a Controlled Entity based on just ip Address. Mac Address is initialized to be a dummy one.
      Parameters:
        `ipp` - ip address of the controlled entity

    - #### ControlledEntityModel

          public ControlledEntityModel(IpAddress ipp,
                               MacAddress mc)

      Creates a ControledEntity instance.
      Parameters:
        `ipp` - ip address of the controlled entity
        `mc` - mac address ofhte controller entity

  - ### Method Detail

    - #### ip

          public IpAddress ip()

      Returns the ip.
      Specified by:
        `ip` in interface `ControlledEntity`
      Returns:
        ip address of the controlled entity

    - #### mac

          public MacAddress mac()

      Returns the mac.
      Specified by:
        `mac` in interface `ControlledEntity`
      Returns:
        mac address ofhte controlled entity

    - #### setMacAddress

          public void setMacAddress(MacAddress macAddress)

      Assigns the given mac to this controlled entity.
      Parameters:
        `macAddress` - the macAddress to set

    - #### setIpAddress

          public void setIpAddress(IpAddress ipAddress)

      Assigns the given ip to this controlled entity.
      Parameters:
        `ipAddress` - the ipAddress to set

    - #### hashCode

          public int hashCode()

      Depends on the ipAddress hashcode.
      Overrides:
        `hashCode` in class `Object`
      Returns:
        computed hashcode

    - #### equals

          public boolean equals(Object obj)

      This implementation bases equality on the IP address only.

      Overrides:
        `equals` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### compareTo

          public int compareTo(ControlledEntityModel other)

      Specified by:
        `compareTo` in interface `Comparable<ControlledEntityModel>`

Copyright © 2014. All Rights Reserved.