|
27 | 27 | */ |
28 | 28 | public enum CollectionStatus { |
29 | 29 |
|
30 | | - /** |
31 | | - * initial state of a new collection |
32 | | - */ |
33 | | - NEW_BORN_COLLECTION(1), |
| 30 | + /** |
| 31 | + * initial state of a new collection |
| 32 | + */ |
| 33 | + NEW_BORN_COLLECTION(1), |
34 | 34 |
|
35 | | - /** |
36 | | - * collection is not in memory |
37 | | - */ |
38 | | - UNLOADED(2), |
| 35 | + /** |
| 36 | + * collection is not in memory |
| 37 | + */ |
| 38 | + UNLOADED(2), |
39 | 39 |
|
40 | | - /** |
41 | | - * collection is in memory |
42 | | - */ |
43 | | - LOADED(3), |
| 40 | + /** |
| 41 | + * collection is in memory |
| 42 | + */ |
| 43 | + LOADED(3), |
44 | 44 |
|
45 | | - /** |
46 | | - * temporary state of a collection in the process of being unloaded |
47 | | - */ |
48 | | - IN_THE_PROCESS_OF_BEING_UNLOADED(4), |
| 45 | + /** |
| 46 | + * temporary state of a collection in the process of being unloaded |
| 47 | + */ |
| 48 | + IN_THE_PROCESS_OF_BEING_UNLOADED(4), |
49 | 49 |
|
50 | | - /** |
51 | | - * deleted state |
52 | | - */ |
53 | | - DELETED(5) |
54 | | - ; |
55 | | - |
56 | | - private static class Holder implements Serializable { |
57 | | - private static final long serialVersionUID = -7016368432042468015L; |
58 | | - private static TreeMap<Integer, CollectionStatus> lookupMap = new TreeMap<Integer, CollectionStatus>(); |
59 | | - } |
60 | | - |
61 | | - private final int status; |
62 | | - private CollectionStatus(int status) { |
63 | | - this.status = status; |
64 | | - Holder.lookupMap.put(status, this); |
65 | | - } |
66 | | - public int status() { |
67 | | - return status; |
68 | | - } |
69 | | - public static CollectionStatus valueOf(int status) { |
70 | | - return Holder.lookupMap.get(status); |
71 | | - } |
| 50 | + /** |
| 51 | + * deleted state |
| 52 | + */ |
| 53 | + DELETED(5); |
| 54 | + |
| 55 | + private static class Holder implements Serializable { |
| 56 | + private static final long serialVersionUID = -7016368432042468015L; |
| 57 | + private static TreeMap<Integer, CollectionStatus> lookupMap = new TreeMap<Integer, CollectionStatus>(); |
| 58 | + |
| 59 | + private Holder() { |
| 60 | + // do nothing here |
| 61 | + } |
| 62 | + } |
| 63 | + |
| 64 | + private final int status; |
| 65 | + |
| 66 | + private CollectionStatus(int status) { |
| 67 | + this.status = status; |
| 68 | + Holder.lookupMap.put(status, this); |
| 69 | + } |
| 70 | + |
| 71 | + public int status() { |
| 72 | + return status; |
| 73 | + } |
| 74 | + |
| 75 | + public static CollectionStatus valueOf(int status) { |
| 76 | + return Holder.lookupMap.get(status); |
| 77 | + } |
72 | 78 | } |
0 commit comments