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