Removes the attribute with the specified AttributeTypes.
The removed attribute are returned by this method.
If there is no attribute with the specified AttributeTypes, the return value is null.
null
830831832833834835836837838839840
else { if ( attribute.size() == 0 ) { // Remove the attribute from the entry tempEntry.removeAttributes( attributeType ); } else { // Replace the existing values with the new values // This is done by removing the Attribute
836837838839840841842843844845846
} else { // Replace the existing values with the new values // This is done by removing the Attribute tempEntry.removeAttributes( attributeType ); // Create the new Attribute Attribute newAttribute = createNewAttribute( attribute ); tempEntry.put( newAttribute );
215216217218219220221222223224225
Entry modifiedEntry = super.modify( modifyContext.getDn(), modifyContext.getModItems().toArray( new Modification[] {} ) ); // Remove the EntryDN modifiedEntry.removeAttributes( ENTRY_DN_AT ); modifyContext.setAlteredEntry( modifiedEntry ); } catch ( Exception e ) {
320321322323324325326327328329330
if ( suffixEntry != null ) { Entry entry = master.get( suffixId ); // Don't write the EntryDN attribute entry.removeAttributes( ENTRY_DN_AT ); entry.setDn( suffixDn ); appendLdif( entry );
360361362363364365366367368369370
IndexEntry<ParentIdAndRdn, String> element = cursor.get(); String childId = element.getId(); Entry entry = fetch( childId ); // Remove the EntryDn entry.removeAttributes( SchemaConstants.ENTRY_DN_AT ); appendLdif( entry ); countChildren++;
658659660661662663664665666667668
// Now remove the ObjectClass attribute if it has not been requested if ( ( lookupContext.getReturningAttributes() != null ) && ( lookupContext.getReturningAttributes().size() != 0 ) && ( ( serverEntry.get( SchemaConstants.OBJECT_CLASS_AT ) != null ) && ( serverEntry.get( SchemaConstants.OBJECT_CLASS_AT ).size() == 0 ) ) ) { serverEntry.removeAttributes( SchemaConstants.OBJECT_CLASS_AT ); } return serverEntry; }
964965966967968969970971972973974
Attribute attrSN = new DefaultAttribute( "sn", "Test1", "Test2" ); Attribute attrPWD = new DefaultAttribute( "userPassword", BYTES1, BYTES2 ); entry.put( attrOC, attrCN, attrSN, attrPWD ); entry.removeAttributes( "CN", "SN" ); assertFalse( entry.containsAttribute( "cn", "sn" ) ); assertTrue( entry.containsAttribute( "objectclass", "userpassword" ) ); entry.removeAttributes( "badId" );
969970971972973974975976977978979
entry.removeAttributes( "CN", "SN" ); assertFalse( entry.containsAttribute( "cn", "sn" ) ); assertTrue( entry.containsAttribute( "objectclass", "userpassword" ) ); entry.removeAttributes( "badId" ); entry.removeAttributes( ( String ) null ); }
971972973974975976977978979980981
assertFalse( entry.containsAttribute( "cn", "sn" ) ); assertTrue( entry.containsAttribute( "objectclass", "userpassword" ) ); entry.removeAttributes( "badId" ); entry.removeAttributes( ( String ) null ); } /** * Test method for remove( EntryAttribute... )
12551256125712581259126012611262126312641265
entry.add( "userCertificate;binary", Strings.getBytesUtf8( "secret" ) ); assertTrue( entry.containsAttribute( "userCertificate;binary" ) ); assertTrue( entry.containsAttribute( "userCertificate" ) ); entry.removeAttributes( "userCertificate;binary" ); assertFalse( entry.containsAttribute( "userCertificate;binary" ) ); assertFalse( entry.containsAttribute( "userCertificate" ) ); entry.add( "userCertificate", Strings.getBytesUtf8( "secret" ) ); assertTrue( entry.containsAttribute( "userCertificate;binary" ) );