public class MutationUtils
extends java.lang.Object
Constructor and Description |
---|
MutationUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
applyToClass(Architecture arch,
Class clazz)
Apply class to interface
|
static void |
applyToInterface(Architecture arch,
Interface interf)
Apply interface to architecture
|
static boolean |
checkSameLayer(Package source,
Package target)
Verify if is same layer of packages
|
static void |
createAssociation(Architecture arch,
Class targetClass,
Class sourceClass)
Create association between classes
|
static Class |
findOrCreateClassWithConcernWithConcernName(Package targetComp,
Concern concern,
Class origin)
Find or create a class with a concern according its name
|
static Interface |
findOrCreateInterfaceWithConcernWithConcernName(Package targetComp,
Concern concern,
Interface origin) |
static GeneralizationRelationship |
getGeneralizationRelationshipForClass(Class clazz)
Get generalizations of class
|
static Concern |
getMajorConcern(Class clazz)
Get major concern by class
|
static Concern |
getMajorConcern(Interface interf)
Get major concern by interface
|
static Class |
getRandomClass(java.util.List<Class> classes)
Get random class from list of classes
|
static Interface |
getRandomInterface(java.util.List<Interface> interfaces)
Get random interface from list of elements
|
static Method |
getRandomMethod(java.util.List<Method> methods)
Get random method from list of methods
|
static Package |
getRandomPackage(Architecture architecture)
Get random package from architecture
|
static Package |
getRandomPackage(java.util.List<Package> packages)
Get random package from list of elements
|
static java.lang.String |
getSuffix(Package pack)
Get package suffix
|
static boolean |
isOptional(Class clazz)
Verify if the class is optional
|
static boolean |
isValidSolution(Architecture solution)
Verify if is a valid solution
|
static boolean |
isVariant(Architecture arch,
Class clazz)
Verify if is variant
|
static boolean |
isVariantOfConcern(Architecture arch,
Class clazz,
Concern concern)
Verify if the concern is variant
|
static boolean |
isVariationPoint(Architecture arch,
Class clazz)
Verify if is variation point
|
static boolean |
isVarPointOfConcern(Architecture arch,
Class clazz,
Concern concern)
Verify if the concern is variation point
|
static void |
moveAttribute(Architecture arch,
Class targetClass,
Class sourceClass)
Move attribute between classes
|
static void |
moveAttributeToNewClass(Architecture arch,
Class sourceClass,
java.util.List<Attribute> attributes,
Class targetClass)
Move attributes to target class
|
static void |
moveHierarchyToComponent(Class classComp,
Package targetComp,
Architecture architecture)
Move generalization to other package
|
static void |
moveMethod(Architecture arch,
Class targetClass,
Class sourceClass)
Move method between classes
|
static void |
moveMethodToNewClass(Architecture architecture,
Class sourceClass,
java.util.List<Method> methodsClass,
Class targetClass)
Move method to new class
|
static <T> T |
randomObject(java.util.List<T> allObjects)
Get a random element from list of elements
|
static void |
removeClassesInPatternStructureFromArray(java.util.List<Class> classes)
Remove classes that has a pattern applied
|
static void |
removeInterfacesInPatternStructureFromArray(java.util.List<Interface> interfaces)
Remove interfaces that has a pattern applied
|
static boolean |
searchForGeneralizations(Class clazz)
Verify if the class has generalizations
|
static boolean |
searchPatternsClass(Class clazz)
Verify if the class has patterns
|
static boolean |
searchPatternsInterface(Interface inter)
Verify if the interface has patterns
|
static boolean |
VerifyIfIsHomonimo(Class clazz)
Verify if is homonimo
|
public static <T> T randomObject(java.util.List<T> allObjects)
T
- type of elementallObjects
- list of elementspublic static Package getRandomPackage(Architecture architecture)
architecture
- architecturepublic static Package getRandomPackage(java.util.List<Package> packages)
packages
- packagespublic static Interface getRandomInterface(java.util.List<Interface> interfaces)
interfaces
- interfacespublic static Class getRandomClass(java.util.List<Class> classes)
classes
- classespublic static Method getRandomMethod(java.util.List<Method> methods)
methods
- methodspublic static void removeClassesInPatternStructureFromArray(java.util.List<Class> classes)
classes
- classespublic static void removeInterfacesInPatternStructureFromArray(java.util.List<Interface> interfaces)
interfaces
- interfacespublic static void moveMethodToNewClass(Architecture architecture, Class sourceClass, java.util.List<Method> methodsClass, Class targetClass) throws java.lang.Exception
architecture
- architecturesourceClass
- source classmethodsClass
- list of methods to movetargetClass
- target classjava.lang.Exception
- default exceptionpublic static boolean searchForGeneralizations(Class clazz)
clazz
- classpublic static boolean searchPatternsClass(Class clazz)
clazz
- classpublic static boolean searchPatternsInterface(Interface inter)
inter
- interfacepublic static void moveAttribute(Architecture arch, Class targetClass, Class sourceClass) throws java.lang.Exception
arch
- architecturetargetClass
- target classsourceClass
- source classjava.lang.Exception
- default exceptionpublic static void createAssociation(Architecture arch, Class targetClass, Class sourceClass)
arch
- architecturetargetClass
- target classsourceClass
- source classpublic static void moveMethod(Architecture arch, Class targetClass, Class sourceClass)
arch
- architecturetargetClass
- target classsourceClass
- source classpublic static void moveAttributeToNewClass(Architecture arch, Class sourceClass, java.util.List<Attribute> attributes, Class targetClass) throws java.lang.Exception
arch
- architecturesourceClass
- source classattributes
- attributestargetClass
- target classjava.lang.Exception
- default exceptionpublic static boolean checkSameLayer(Package source, Package target)
source
- source packagetarget
- target packagepublic static java.lang.String getSuffix(Package pack)
pack
- packagepublic static boolean isVarPointOfConcern(Architecture arch, Class clazz, Concern concern)
arch
- architectureclazz
- classconcern
- concernpublic static boolean isVariantOfConcern(Architecture arch, Class clazz, Concern concern)
arch
- architectureclazz
- classconcern
- concernpublic static void moveHierarchyToComponent(Class classComp, Package targetComp, Architecture architecture)
classComp
- class generalizationtargetComp
- target packagearchitecture
- architecturepublic static GeneralizationRelationship getGeneralizationRelationshipForClass(Class clazz)
clazz
- classpublic static boolean isOptional(Class clazz)
clazz
- classpublic static boolean isVariant(Architecture arch, Class clazz)
arch
- architectureclazz
- classpublic static boolean isVariationPoint(Architecture arch, Class clazz)
arch
- architectureclazz
- classpublic static boolean isValidSolution(Architecture solution)
solution
- solutionpublic static void applyToClass(Architecture arch, Class clazz) throws ConcernNotFoundException
arch
- architectureclazz
- classConcernNotFoundException
- default exceptionpublic static boolean VerifyIfIsHomonimo(Class clazz)
clazz
- classpublic static void applyToInterface(Architecture arch, Interface interf) throws ConcernNotFoundException
arch
- architectureinterf
- interfaceConcernNotFoundException
- default exceptionpublic static Interface findOrCreateInterfaceWithConcernWithConcernName(Package targetComp, Concern concern, Interface origin) throws ConcernNotFoundException
ConcernNotFoundException
public static Concern getMajorConcern(Class clazz)
clazz
- classpublic static Concern getMajorConcern(Interface interf)
interf
- interfacepublic static Class findOrCreateClassWithConcernWithConcernName(Package targetComp, Concern concern, Class origin) throws ConcernNotFoundException
targetComp
- targetconcern
- concernorigin
- originConcernNotFoundException
- default exception