private BonjourEvent newBonjourEvent(BonjourEvent.Type type,ServiceEvent event){
  ServiceInfo info=event.getInfo();
  BonjourService.Builder serviceBuilder=new BonjourService.Builder(event.getName(),event.getType());
  Enumeration<String> keys=info.getPropertyNames();
  while (keys.hasMoreElements()) {
    String key=keys.nextElement();
    serviceBuilder.addTxtRecord(key,info.getPropertyString(key));
  }
  InetAddress[] addresses=info.getInetAddresses();
  for (  InetAddress address : addresses) {
    if (address == null)     continue;
    serviceBuilder.addAddress(address);
  }
  serviceBuilder.setPort(info.getPort());
  return new BonjourEvent(type,serviceBuilder.build());
}

private BonjourEvent newBonjourEvent ( BonjourEvent . Type type , ServiceEvent event ) { ServiceInfo info = event . getInfo ( ) ; BonjourService . Builder serviceBuilder = new BonjourService . Builder ( event . getName ( ) , event . getType ( ) ) ; Enumeration < String > keys = info . getPropertyNames ( ) ; while ( keys . hasMoreElements ( ) ) { String key = keys . nextElement ( ) ; serviceBuilder . addTxtRecord ( key , info . getPropertyString ( key ) ) ; } InetAddress [ ] addresses = info . getInetAddresses ( ) ; for ( InetAddress address : addresses ) { if ( address == null ) continue ; serviceBuilder . addAddress ( address ) ; } serviceBuilder . setPort ( info . getPort ( ) ) ; return new BonjourEvent ( type , serviceBuilder . build ( ) ) ; }
creates a new bonjourevent instance from a jmdns serviceevent .
