public void addRosterEntry ( RosterEntry rosterEntry ) { // Obtain a String[] from the roster entry groups name List < String > groupNamesList = new ArrayList <> ( ) ; String [ ] groupNames ; for ( RosterGroup group : rosterEntry . getGroups ( ) ) { groupNamesList . add ( group . getName ( ) ) ; } groupNames = groupNamesList . toArray ( new String [ groupNamesList . size ( ) ] ) ; // Create a new Entry based on the rosterEntry and add it to the packet RemoteRosterEntry remoteRosterEntry = new RemoteRosterEntry ( rosterEntry . getJid ( ) , rosterEntry . getName ( ) , groupNames ) ; addRosterEntry ( remoteRosterEntry ) ; }
Adds a roster entry to the packet .