private List<LdapMod> createAtts(ILdapEntry entry){
  String[] attrs=entry.getAttributeNames();
  List<LdapMod> objAttributes=new ArrayList<>();
  for (  String attr : attrs) {
    if (!attr.equalsIgnoreCase("cn") && !attr.equalsIgnoreCase("nTSecurityDescriptor")) {
      LdapValue[] values=entry.getAttributeValues(attr);
      LdapMod mod=new LdapMod(LdapModOperation.ADD,attr,values);
      objAttributes.add(mod);
    }
  }
  return objAttributes;
}

private List < LdapMod > createAtts ( ILdapEntry entry ) { String [ ] attrs = entry . getAttributeNames ( ) ; List < LdapMod > objAttributes = new ArrayList < > ( ) ; for ( String attr : attrs ) { if ( ! attr . equalsIgnoreCase ( "cn" ) && ! attr . equalsIgnoreCase ( "nTSecurityDescriptor" ) ) { LdapValue [ ] values = entry . getAttributeValues ( attr ) ; LdapMod mod = new LdapMod ( LdapModOperation . ADD , attr , values ) ; objAttributes . add ( mod ) ; } } return objAttributes ; }
this would formulate all attributes for object to be added .
