1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package org.basepom.mojo.duplicatefinder;
16
17 import static com.google.common.base.Preconditions.checkState;
18
19 public enum ConflictState {
20
21 NO_CONFLICT("no-conflict", ""),
22 CONFLICT_CONTENT_EQUAL("content-equal", "(but equal)"),
23 CONFLICT_CONTENT_DIFFERENT("content-different", "and different");
24
25 private final String value;
26 private final String hint;
27
28 ConflictState(String value, String hint) {
29 this.value = value;
30 this.hint = hint;
31 }
32
33 public String getHint() {
34 return hint;
35 }
36
37 public static ConflictState max(final ConflictState... states) {
38 checkState(states.length > 0, "states is empty");
39
40 ConflictState result = states[0];
41 for (int i = 1; i < states.length; i++) {
42 if (states[i].ordinal() > result.ordinal()) {
43 result = states[i];
44 }
45 }
46
47 return result;
48 }
49
50 @Override
51 public String toString() {
52 return value;
53 }
54 }