org.mule.devkit.generation.studio.utils
Class ModuleComparator

java.lang.Object
  extended by org.mule.devkit.generation.studio.utils.ModuleComparator
All Implemented Interfaces:
Comparator<org.mule.devkit.model.module.Module>

public class ModuleComparator
extends Object
implements Comparator<org.mule.devkit.model.module.Module>

Sorts the modules according to their types, where Connection Management go first against Oauth ones. This is a fix for multi modules (see DEVKIT-548)


Constructor Summary
ModuleComparator()
           
 
Method Summary
 int compare(org.mule.devkit.model.module.Module m, org.mule.devkit.model.module.Module m2)
          Compares two modules, and sorts them using their types.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

ModuleComparator

public ModuleComparator()
Method Detail

compare

public int compare(org.mule.devkit.model.module.Module m,
                   org.mule.devkit.model.module.Module m2)
Compares two modules, and sorts them using their types. Where Connection management modules have precedence against Oauth ones.

Specified by:
compare in interface Comparator<org.mule.devkit.model.module.Module>
Parameters:
m - a ManagedConnectionModule/OAuthModule to be tested
m2 - a ManagedConnectionModule/OAuthModule to be tested
Returns:
a -1, 0, or 1 as the first module m is less than, equal to, or greater than the second module m2.


Copyright © 2010–2014 MuleSoft, Inc.. All rights reserved.