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
} 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 );
654655656657658659660661662663664
// Now remove the ObjectClass attribute if it has not been requested if ( ( lookupContext.getAttrsId() != null ) && ( lookupContext.getAttrsId().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; }
25182519252025212522252325242525252625272528
assertEquals( 1, entry.size() ); assertNotNull( entry.get( "domainComponent" ) ); assertEquals( 1, entry.get( "domainComponent" ).size() ); assertNotNull( entry.get( "domainComponent" ).get() ); assertNull( entry.get( "domainComponent" ).get().getValue() ); entry.removeAttributes( "dc" ); replaced = entry.put( "DC", strValue3 ); assertNull( replaced ); assertEquals( 1, entry.size() ); assertNotNull( entry.get( "dc" ) );
99100101102103104105106107108109
case REMOVE_ATTRIBUTE: Attribute toBeRemoved = mod.getAttribute(); if ( toBeRemoved.size() == 0 ) { targetEntry.removeAttributes( id ); } else { existing = targetEntry.get( id );
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" ) );
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... )
458459460461462463464465466467468
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 );