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
11551156115711581159116011611162116311641165
AttributeType attributeType = attribute.getAttributeType(); String oid = attributeType.getOid(); if ( !lookupContext.getAttrsId().contains( oid ) ) { entry.removeAttributes( attributeType ); } } } } }
894895896897898899900901902903904
// We may have to remove the attribute or only some values if ( attribute.size() == 0 ) { // No value : we have to remove the entire attribute tempEntry.removeAttributes( attributeType ); } else { currentAttribute = tempEntry.get( attributeType );
920921922923924925926927928929930
// If the current attribute is empty, we have to remove // it from the entry if ( currentAttribute.size() == 0 ) { tempEntry.removeAttributes( attributeType ); } } break;
950951952953954955956957958959960
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
956957958959960961962963964965966
} 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 );
460461462463464465466467468469470
aciContext.setAttributeType( CN_AT ); aciContext.setEntry( entry ); assertEquals( 1, filterA.filter( aciContext, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null ).size() ); entry.removeAttributes( "cn" ); aciContext = new AciContext( null, null ); aciContext.setAciTuples( tuples ); aciContext.setUserDn( USER_NAME ); aciContext.setAttributeType( CN_AT );
273274275276277278279280281282283
case REMOVE_ATTRIBUTE: Attribute toBeRemoved = mod.getAttribute(); if ( toBeRemoved.size() == 0 ) { targetEntry.removeAttributes( id ); } else { Attribute existing = targetEntry.get( id );
99100101102103104105106107108109
case REMOVE_ATTRIBUTE : Attribute toBeRemoved = mod.getAttribute(); if ( toBeRemoved.size() == 0 ) { targetEntry.removeAttributes( id ); } else { existing = targetEntry.get( id );
33453346334733483349335033513352335333543355
Attribute attrSN = new DefaultAttribute( atSN, "Test1", "Test2" ); Attribute attrPWD = new DefaultAttribute( atPwd, BYTES1, BYTES2 ); entry.put( attrOC, attrCN, attrSN, attrPWD ); entry.removeAttributes( atCN, atSN ); assertFalse( entry.containsAttribute( "cn", "sn" ) ); assertTrue( entry.containsAttribute( "objectclass", "userpassword" ) ); }
33673368336933703371337233733374337533763377
Attribute attrSN = new DefaultAttribute( atSN, "Test1", "Test2" ); Attribute attrPWD = new DefaultAttribute( atPwd, 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" );