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

java.lang.Object
  extended by org.eclipse.emf.emfstore.internal.modelmutator.mutation.MutationPredicates

public final class MutationPredicates
extends Object

A set of predicates used by mutations for selecting, filtering, checking objects and features.

Author:
Philip Langer

Field Summary
static String EXTENDED_META_DATA
          Extended meta data source of EAnnotations.
static String GROUP
          Value of a details entry in EAnnotations to denote Feature Map groups.
static com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EStructuralFeature> HAS_FEATURE_MAP_ENTRY_TYPE
          Predicate specifying whether an EStructuralFeature is of type FeatureMapEntry.
static com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EStructuralFeature> HAS_GROUP_FEATURE_MAP_ENTRY_TYPE
          Predicate specifying whether an EStructuralFeature is the feature map attribute of a feature map group.
static com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EStructuralFeature> IS_CONTAINMENT_OR_OPPOSITE_OF_CONTAINMENT_REFERENCE
          Predicate specifying whether an EStructuralFeature is a containment EReference or the opposite of a containment EReference.
static com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EStructuralFeature> IS_CONTAINMENT_REFERENCE
          Predicate specifying whether an EStructuralFeature is a containment EReference.
static com.google.common.base.Predicate<? super Object> IS_LIST
          Predicate specifying whether an Object is a list.
static com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EStructuralFeature> IS_MULTI_VALUED
          Predicate specifying whether an EStructuralFeature is multi-valued.
static com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EStructuralFeature> IS_MUTABLE
          Predicate specifying whether an EStructuralFeature is mutable.
static com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EStructuralFeature> IS_MUTABLE_ATTRIBUTE
          Predicate specifying whether an EStructuralFeature is a mutable EAttribute.
static com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EStructuralFeature> IS_MUTABLE_CONTAINMENT_REFERENCE
          Predicate specifying whether an EStructuralFeature is a mutable containment EReference.
static com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EStructuralFeature> IS_MUTABLE_REFERENCE
          Predicate specifying whether an EStructuralFeature is a mutable EReference.
static com.google.common.base.Predicate<? super Object> IS_NON_EMPTY_EOBJECT_LIST
          Predicate specifying whether an Object is a list of EObjects containing at least one EObject.
static com.google.common.base.Predicate<? super Object> IS_NON_EMPTY_EOBJECT_OR_LIST
          Predicate specifying whether an Object is an EObject or a list of EObjects containing at least one EObject.
static com.google.common.base.Predicate<? super Object> IS_NON_EMPTY_FEATURE_MAP
          Predicate specifying whether an Object is a feature map containing at least one value.
static com.google.common.base.Predicate<? super Object> IS_NON_EMPTY_VALUE_OR_LIST
          Predicate specifying whether an Object is not null or an empty list.
static com.google.common.base.Predicate<? super Object> IS_NON_NULL_EOBJECT
          Predicate specifying whether an Object is not null and an EObject.
static com.google.common.base.Predicate<? super Object> IS_NULL_OR_LIST
          Predicate specifying whether an Object is null or a list.
static com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EStructuralFeature> IS_OPPOSITE_OF_CONTAINMENT_REFERENCE
          Predicate specifying whether an EStructuralFeature is the opposite of a containment EReference.
static com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EStructuralFeature> IS_REFERENCE
          Predicate specifying whether an EStructuralFeature is a EReference.
static String KIND
          Key of a details entry in EAnnotations to denote FeatureMap groups.
 
Method Summary
static com.google.common.base.Predicate<? super Object> containsEObjectWithMaxNumberOfContainments(int maxNumberOfContainments)
          Predicate specifying whether an Object is the container of an EObject that itself has at most the given number of maxNumberOfContainments.
static com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EStructuralFeature> hasCompatibleType(org.eclipse.emf.ecore.EStructuralFeature feature)
          Predicate specifying whether an EStructuralFeature has a compatible type to the given feature.
static com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EObject> hasMaxNumberOfContainments(int maxNumberOfContainments)
          Predicate specifying whether an EObject contains at most the given number of maxNumberOfContainments.
static com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EObject> isAncestor(org.eclipse.emf.ecore.EObject eObject)
          Predicate specifying whether an EObject is the ancestor of a given eObject.
static com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EObject> isChild(org.eclipse.emf.ecore.EObject eObject)
          Predicate specifying whether an EObject is the child of the given eObject.
static com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EStructuralFeature> isCompatibleWithAnyFeatureOfEClass(org.eclipse.emf.ecore.EClass eClass)
          Predicate specifying whether an EStructuralFeature has a compatible type to any of the features' types of the given eClass.
static com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EObject> isContainedByEObject(org.eclipse.emf.ecore.EObject eContainer)
          Predicate specifying whether an EObject is contained by the given eContainer.
static com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EObject> isContainedByFeature(org.eclipse.emf.ecore.EStructuralFeature feature)
          Predicate specifying whether an EObject is contained by the given feature.
static com.google.common.base.Predicate<? super Object> isEObjectWithMaxNumberOfContainments(int maxNumberOfContainments)
          Predicate specifying whether an Object is an EObject containing at most the given number of maxNumberOfContainments.
static com.google.common.base.Predicate<? super Object> isListContainingEObjectWithMaxNumberOfContainments(int maxNumberOfContainments)
          Predicate specifying whether an Object is a list of EObjects containing one EObject that itself has at most the given number of maxNumberOfContainments.
static com.google.common.base.Predicate<? super Object> isListWithSpecifiedSize(int size)
          Predicate specifying whether an Object is a list with the given size.
static com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EObject> isNotTheSame(org.eclipse.emf.ecore.EObject eObject)
          Predicate specifying whether an EObject is not the same as the given eObject.
static com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EObject> mayBeContainedByAnyOfTheseReferences(Iterable<org.eclipse.emf.ecore.EReference> references)
          Predicate specifying whether an EObject may be contained by any of the given references.
static com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EObject> mayBeContainedByFeature(org.eclipse.emf.ecore.EStructuralFeature feature)
          Predicate specifying whether an EObject may be contained by the given feature.
static com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EStructuralFeature> mayTakeEObjectAsValue(org.eclipse.emf.ecore.EObject eObject)
          Predicate specifying whether an EStructuralFeature may take the given eObject as value.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXTENDED_META_DATA

public static final String EXTENDED_META_DATA
Extended meta data source of EAnnotations.

See Also:
Constant Field Values

KIND

public static final String KIND
Key of a details entry in EAnnotations to denote FeatureMap groups.

See Also:
Constant Field Values

GROUP

public static final String GROUP
Value of a details entry in EAnnotations to denote Feature Map groups.

See Also:
Constant Field Values

IS_REFERENCE

public static final com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EStructuralFeature> IS_REFERENCE
Predicate specifying whether an EStructuralFeature is a EReference.


IS_CONTAINMENT_REFERENCE

public static final com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EStructuralFeature> IS_CONTAINMENT_REFERENCE
Predicate specifying whether an EStructuralFeature is a containment EReference.


IS_CONTAINMENT_OR_OPPOSITE_OF_CONTAINMENT_REFERENCE

public static final com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EStructuralFeature> IS_CONTAINMENT_OR_OPPOSITE_OF_CONTAINMENT_REFERENCE
Predicate specifying whether an EStructuralFeature is a containment EReference or the opposite of a containment EReference.


IS_OPPOSITE_OF_CONTAINMENT_REFERENCE

public static final com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EStructuralFeature> IS_OPPOSITE_OF_CONTAINMENT_REFERENCE
Predicate specifying whether an EStructuralFeature is the opposite of a containment EReference.


IS_MUTABLE_CONTAINMENT_REFERENCE

public static final com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EStructuralFeature> IS_MUTABLE_CONTAINMENT_REFERENCE
Predicate specifying whether an EStructuralFeature is a mutable containment EReference.


IS_MUTABLE

public static final com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EStructuralFeature> IS_MUTABLE
Predicate specifying whether an EStructuralFeature is mutable.


IS_MULTI_VALUED

public static final com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EStructuralFeature> IS_MULTI_VALUED
Predicate specifying whether an EStructuralFeature is multi-valued.


IS_MUTABLE_ATTRIBUTE

public static final com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EStructuralFeature> IS_MUTABLE_ATTRIBUTE
Predicate specifying whether an EStructuralFeature is a mutable EAttribute.


IS_MUTABLE_REFERENCE

public static final com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EStructuralFeature> IS_MUTABLE_REFERENCE
Predicate specifying whether an EStructuralFeature is a mutable EReference.


HAS_FEATURE_MAP_ENTRY_TYPE

public static final com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EStructuralFeature> HAS_FEATURE_MAP_ENTRY_TYPE
Predicate specifying whether an EStructuralFeature is of type FeatureMapEntry.


HAS_GROUP_FEATURE_MAP_ENTRY_TYPE

public static final com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EStructuralFeature> HAS_GROUP_FEATURE_MAP_ENTRY_TYPE
Predicate specifying whether an EStructuralFeature is the feature map attribute of a feature map group.


IS_NON_EMPTY_VALUE_OR_LIST

public static final com.google.common.base.Predicate<? super Object> IS_NON_EMPTY_VALUE_OR_LIST
Predicate specifying whether an Object is not null or an empty list.


IS_NON_EMPTY_FEATURE_MAP

public static final com.google.common.base.Predicate<? super Object> IS_NON_EMPTY_FEATURE_MAP
Predicate specifying whether an Object is a feature map containing at least one value.


IS_NON_EMPTY_EOBJECT_OR_LIST

public static final com.google.common.base.Predicate<? super Object> IS_NON_EMPTY_EOBJECT_OR_LIST
Predicate specifying whether an Object is an EObject or a list of EObjects containing at least one EObject.


IS_NON_NULL_EOBJECT

public static final com.google.common.base.Predicate<? super Object> IS_NON_NULL_EOBJECT
Predicate specifying whether an Object is not null and an EObject.


IS_NON_EMPTY_EOBJECT_LIST

public static final com.google.common.base.Predicate<? super Object> IS_NON_EMPTY_EOBJECT_LIST
Predicate specifying whether an Object is a list of EObjects containing at least one EObject.


IS_NULL_OR_LIST

public static final com.google.common.base.Predicate<? super Object> IS_NULL_OR_LIST
Predicate specifying whether an Object is null or a list.


IS_LIST

public static final com.google.common.base.Predicate<? super Object> IS_LIST
Predicate specifying whether an Object is a list.

Method Detail

mayTakeEObjectAsValue

public static com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EStructuralFeature> mayTakeEObjectAsValue(org.eclipse.emf.ecore.EObject eObject)
Predicate specifying whether an EStructuralFeature may take the given eObject as value.

Parameters:
eObject - The EObject to check.
Returns:
true if it may take eObject as value, false otherwise.

hasCompatibleType

public static com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EStructuralFeature> hasCompatibleType(org.eclipse.emf.ecore.EStructuralFeature feature)
Predicate specifying whether an EStructuralFeature has a compatible type to the given feature.

Parameters:
feature - The EStructuralFeature to check.
Returns:
true if its type is compatible to the one of feature, false otherwise.

isCompatibleWithAnyFeatureOfEClass

public static com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EStructuralFeature> isCompatibleWithAnyFeatureOfEClass(org.eclipse.emf.ecore.EClass eClass)
Predicate specifying whether an EStructuralFeature has a compatible type to any of the features' types of the given eClass.

Parameters:
eClass - The EClass to check.
Returns:
true if there is at least one feature in eClass having a compatible type, false otherwise.

mayBeContainedByFeature

public static com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EObject> mayBeContainedByFeature(org.eclipse.emf.ecore.EStructuralFeature feature)
Predicate specifying whether an EObject may be contained by the given feature.

Parameters:
feature - The EStructuralFeature to check.
Returns:
true if it may be contained by feature, false otherwise.

mayBeContainedByAnyOfTheseReferences

public static com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EObject> mayBeContainedByAnyOfTheseReferences(Iterable<org.eclipse.emf.ecore.EReference> references)
Predicate specifying whether an EObject may be contained by any of the given references.

Parameters:
references - The references to check.
Returns:
true if there is at least one reference in references, which may contain it, false otherwise.

isNotTheSame

public static com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EObject> isNotTheSame(org.eclipse.emf.ecore.EObject eObject)
Predicate specifying whether an EObject is not the same as the given eObject.

Parameters:
eObject - The EObject to compare it to.
Returns:
true if it is not the same, false otherwise.

isChild

public static com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EObject> isChild(org.eclipse.emf.ecore.EObject eObject)
Predicate specifying whether an EObject is the child of the given eObject.

Parameters:
eObject - The EObject to check.
Returns:
true if it is a child of eObject, false otherwise.

isAncestor

public static com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EObject> isAncestor(org.eclipse.emf.ecore.EObject eObject)
Predicate specifying whether an EObject is the ancestor of a given eObject.

Parameters:
eObject - The EObject to check.
Returns:
true if it is the ancestor of eObject, false otherwise.

isContainedByFeature

public static com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EObject> isContainedByFeature(org.eclipse.emf.ecore.EStructuralFeature feature)
Predicate specifying whether an EObject is contained by the given feature.

Parameters:
feature - The EStructuralFeature to check.
Returns:
true if it is contained by feature, false otherwise.

isContainedByEObject

public static com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EObject> isContainedByEObject(org.eclipse.emf.ecore.EObject eContainer)
Predicate specifying whether an EObject is contained by the given eContainer.

Parameters:
eContainer - The EObject to check.
Returns:
true if it is contained by eContainer, false otherwise.

containsEObjectWithMaxNumberOfContainments

public static com.google.common.base.Predicate<? super Object> containsEObjectWithMaxNumberOfContainments(int maxNumberOfContainments)
Predicate specifying whether an Object is the container of an EObject that itself has at most the given number of maxNumberOfContainments.

Parameters:
maxNumberOfContainments - The maximum number of containments to check.
Returns:
true if it contains an EObject that itself has a less or equal number of containments than specified in maxNumberOfContainments, false otherwise.

isListContainingEObjectWithMaxNumberOfContainments

public static com.google.common.base.Predicate<? super Object> isListContainingEObjectWithMaxNumberOfContainments(int maxNumberOfContainments)
Predicate specifying whether an Object is a list of EObjects containing one EObject that itself has at most the given number of maxNumberOfContainments.

Parameters:
maxNumberOfContainments - The maximum number of containments to check.
Returns:
true if it is a list containing an EObject that itself has a less or equal number of containments than specified in maxNumberOfContainments, false otherwise.

isEObjectWithMaxNumberOfContainments

public static com.google.common.base.Predicate<? super Object> isEObjectWithMaxNumberOfContainments(int maxNumberOfContainments)
Predicate specifying whether an Object is an EObject containing at most the given number of maxNumberOfContainments.

Parameters:
maxNumberOfContainments - The maximum number of containments to check.
Returns:
true if it is is an EObject containing a less or equal number of containments than specified in maxNumberOfContainments, false otherwise.

hasMaxNumberOfContainments

public static com.google.common.base.Predicate<? super org.eclipse.emf.ecore.EObject> hasMaxNumberOfContainments(int maxNumberOfContainments)
Predicate specifying whether an EObject contains at most the given number of maxNumberOfContainments.

Parameters:
maxNumberOfContainments - The maximum number of containments to check.
Returns:
true if it contains a less or equal number of containments than specified in maxNumberOfContainments, false otherwise.

isListWithSpecifiedSize

public static com.google.common.base.Predicate<? super Object> isListWithSpecifiedSize(int size)
Predicate specifying whether an Object is a list with the given size.

Parameters:
size - The size to check.
Returns:
true if it is a list of the given size, false otherwise.


Copyright © 2015. All Rights Reserved.