1 package com.atlassian.plugin;
2
3 import java.io.Serializable;
4 import java.util.Comparator;
5
6 /**
7 * Compares two plugins by their names
8 */
9 class PluginNameComparator implements Comparator<Plugin>, Serializable
10 {
11 static final long serialVersionUID = -2595168544386708474L;
12
13 /**
14 * Gets names of the two given plugins and returns the result of their comparison
15 *
16 * @param p1 plugin to compare
17 * @param p2 plugin to compare
18 * @return result of plugin name comparison
19 */
20 public int compare(Plugin p1, Plugin p2)
21 {
22 return p1.getName().compareTo(p2.getName());
23 }
24 }