org.eclipse.emf.emfstore.internal.modelmutator.mutation
Class AttributeChangeMutation

java.lang.Object
  extended by org.eclipse.emf.emfstore.internal.modelmutator.mutation.Mutation
      extended by org.eclipse.emf.emfstore.internal.modelmutator.mutation.StructuralFeatureMutation<ESAttributeChangeMutation>
          extended by org.eclipse.emf.emfstore.internal.modelmutator.mutation.AttributeChangeMutation
All Implemented Interfaces:
Cloneable, ESAttributeChangeMutation, ESMutation, ESStructuralFeatureMutation<ESAttributeChangeMutation>

public class AttributeChangeMutation
extends StructuralFeatureMutation<ESAttributeChangeMutation>
implements ESAttributeChangeMutation

A mutation, which adds, deletes, or reorders an attribute value of an object.

Author:
Philip Langer

Constructor Summary
AttributeChangeMutation(ESModelMutatorUtil util)
          Creates a new mutation with the specified util.
 
Method Summary
 void apply()
          Applies this mutation and returns whether it succeeded in being applied.
 Mutation clone()
          Mutations must follow the prototype pattern as org.eclipse.emf.emfstore.internal.modelmutator.api.ModelMutator will clone pre-configured mutations before they will be completed and applied.
 ESAttributeChangeMutation setNewValue(Object newValue)
          Sets the value that should be used when changing the attribute.
 ESAttributeChangeMutation setRandomChangeMode(ESRandomChangeMode mode)
          Sets the change mode for this attribute change.
 
Methods inherited from class org.eclipse.emf.emfstore.internal.modelmutator.mutation.StructuralFeatureMutation
getExcludedTargetEClasses, getExcludedTargetFeatures, getExcludedTargetObjects, getTargetFeature, getTargetObject, setTargetFeature, setTargetObject
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.emf.emfstore.modelmutator.ESStructuralFeatureMutation
getExcludedTargetEClasses, getExcludedTargetFeatures, getExcludedTargetObjects, getTargetFeature, getTargetObject, setTargetFeature, setTargetObject
 

Constructor Detail

AttributeChangeMutation

public AttributeChangeMutation(ESModelMutatorUtil util)
Creates a new mutation with the specified util.

Parameters:
util - The model mutator util used for accessing the model to be mutated.
Method Detail

clone

public Mutation clone()
Mutations must follow the prototype pattern as org.eclipse.emf.emfstore.internal.modelmutator.api.ModelMutator will clone pre-configured mutations before they will be completed and applied. This allows clients to provide a specifically configured set mutations and start the mutation only from cloning and applying the set of pre-configured mutations.

Specified by:
clone in class Mutation
Returns:
A copy of this mutation with the same configuration.
See Also:
Mutation.clone()

apply

public void apply()
           throws ESMutationException
Applies this mutation and returns whether it succeeded in being applied.

Specified by:
apply in interface ESMutation
Specified by:
apply in class Mutation
Throws:
ESMutationException - thrown if the mutation failed.
See Also:
Mutation.apply()

setNewValue

public ESAttributeChangeMutation setNewValue(Object newValue)
Sets the value that should be used when changing the attribute.

Specified by:
setNewValue in interface ESAttributeChangeMutation
Parameters:
newValue - the value of the attribute
Returns:
this mutation
See Also:
ESAttributeChangeMutation.setNewValue(java.lang.Object)

setRandomChangeMode

public ESAttributeChangeMutation setRandomChangeMode(ESRandomChangeMode mode)
Sets the change mode for this attribute change.

Specified by:
setRandomChangeMode in interface ESAttributeChangeMutation
Parameters:
mode - the random change mode to be set
Returns:
this mutation
See Also:
ESAttributeChangeMutation.setRandomChangeMode(org.eclipse.emf.emfstore.modelmutator.ESRandomChangeMode)


Copyright © 2015. All Rights Reserved.