1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the 7 * "License"); you may not use this file except in compliance 8 * with the License. You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, 13 * software distributed under the License is distributed on an 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 * KIND, either express or implied. See the License for the 16 * specific language governing permissions and limitations 17 * under the License. 18 * 19 */ 20 package org.apache.directory.api.ldap.model.entry; 21 22 23 import java.io.Externalizable; 24 25 import org.apache.directory.api.ldap.model.exception.LdapInvalidAttributeValueException; 26 import org.apache.directory.api.ldap.model.schema.AttributeType; 27 28 29 /** 30 * An internal interface for a ModificationItem. The name has been 31 * chosen so that it does not conflict with @see ModificationItem 32 * 33 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> 34 */ 35 public interface Modification extends Cloneable, Externalizable 36 { 37 /** 38 * @return the operation 39 */ 40 ModificationOperation getOperation(); 41 42 43 /** 44 * Store the modification operation 45 * 46 * @param operation The DirContext value to assign 47 */ 48 void setOperation( int operation ); 49 50 51 /** 52 * Store the modification operation 53 * 54 * @param operation The ModificationOperation value to assign 55 */ 56 void setOperation( ModificationOperation operation ); 57 58 59 /** 60 * @return the attribute containing the modifications 61 */ 62 Attribute getAttribute(); 63 64 65 /** 66 * Set the attribute's modification 67 * 68 * @param attribute The modified attribute 69 */ 70 void setAttribute( Attribute attribute ); 71 72 73 /** 74 * The clone operation 75 * 76 * @return a clone of the current modification 77 */ 78 Modification clone(); 79 80 81 /** 82 * Apply the AttributeType to the Modification 83 * 84 * @param AttributeType the injected AttributeType 85 */ 86 void apply( AttributeType attributeType ) throws LdapInvalidAttributeValueException; 87 }