public IDevice learnEntity(long macAddress,Short vlan,Integer ipv4Address,Long switchDPID,Integer switchPort,boolean processUpdates){
  List<IDeviceListener> listeners=deviceListeners.getOrderedListeners();
  if (!processUpdates) {
    deviceListeners.clearListeners();
  }
  VlanVid v;
  IPv4Address i;
  DatapathId d;
  OFPort p;
  if (vlan != null && vlan.shortValue() <= 0)   vlan=null;
  if (ipv4Address != null && ipv4Address == 0)   ipv4Address=null;
  if (vlan == null) {
    v=VlanVid.ofVlan(-1);
  }
 else {
    v=VlanVid.ofVlan(vlan);
  }
  if (ipv4Address == null) {
    i=IPv4Address.NONE;
  }
 else {
    i=IPv4Address.of(ipv4Address);
  }
  if (switchDPID == null) {
    d=DatapathId.of(0);
  }
 else {
    d=DatapathId.of(switchDPID.longValue());
  }
  if (switchPort == null) {
    p=OFPort.ZERO;
  }
 else {
    p=OFPort.of(switchPort);
  }
  IDevice res=learnDeviceByEntity(new Entity(MacAddress.of(macAddress),v,i,d,p,new Date()));
  if (listeners != null) {
    for (    IDeviceListener listener : listeners) {
      deviceListeners.addListener("device",listener);
    }
  }
  return res;
}

public IDevice learnEntity ( long macAddress , Short vlan , Integer ipv4Address , Long switchDPID , Integer switchPort , boolean processUpdates ) { List < IDeviceListener > listeners = deviceListeners . getOrderedListeners ( ) ; if ( ! processUpdates ) { deviceListeners . clearListeners ( ) ; } VlanVid v ; IPv4Address i ; DatapathId d ; OFPort p ; if ( vlan != null && vlan . shortValue ( ) <= 0 ) vlan = null ; if ( ipv4Address != null && ipv4Address == 0 ) ipv4Address = null ; if ( vlan == null ) { v = VlanVid . ofVlan ( - 1 ) ; } else { v = VlanVid . ofVlan ( vlan ) ; } if ( ipv4Address == null ) { i = IPv4Address . NONE ; } else { i = IPv4Address . of ( ipv4Address ) ; } if ( switchDPID == null ) { d = DatapathId . of ( 0 ) ; } else { d = DatapathId . of ( switchDPID . longValue ( ) ) ; } if ( switchPort == null ) { p = OFPort . ZERO ; } else { p = OFPort . of ( switchPort ) ; } IDevice res = learnDeviceByEntity ( new Entity ( MacAddress . of ( macAddress ) , v , i , d , p , new Date ( ) ) ) ; if ( listeners != null ) { for ( IDeviceListener listener : listeners ) { deviceListeners . addListener ( "device" , listener ) ; } } return res ; }
learn a device using the given characteristics .
