Skip to content

Commit

Permalink
Use EnumMap
Browse files Browse the repository at this point in the history
  • Loading branch information
mangstadt committed Oct 22, 2023
1 parent 11f8d24 commit f36e91c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/java/biweekly/parameter/ParticipationLevel.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Map;

import biweekly.ICalVersion;
Expand Down Expand Up @@ -64,7 +64,7 @@ protected boolean matches(ParticipationLevel object, String value) {
*/
public static final ParticipationLevel REQUIRED;
static {
Map<ICalVersion, String> values = new HashMap<ICalVersion, String>();
Map<ICalVersion, String> values = new EnumMap<ICalVersion, String>(ICalVersion.class);
values.put(ICalVersion.V1_0, "REQUIRE");
values.put(ICalVersion.V2_0_DEPRECATED, "REQ-PARTICIPANT");
values.put(ICalVersion.V2_0, values.get(ICalVersion.V2_0_DEPRECATED));
Expand All @@ -76,7 +76,7 @@ protected boolean matches(ParticipationLevel object, String value) {
*/
public static final ParticipationLevel OPTIONAL;
static {
Map<ICalVersion, String> values = new HashMap<ICalVersion, String>();
Map<ICalVersion, String> values = new EnumMap<ICalVersion, String>(ICalVersion.class);
values.put(ICalVersion.V1_0, "REQUEST");
values.put(ICalVersion.V2_0_DEPRECATED, "OPT-PARTICIPANT");
values.put(ICalVersion.V2_0, values.get(ICalVersion.V2_0_DEPRECATED));
Expand All @@ -89,7 +89,7 @@ protected boolean matches(ParticipationLevel object, String value) {
*/
public static final ParticipationLevel FYI;
static {
Map<ICalVersion, String> values = new HashMap<ICalVersion, String>();
Map<ICalVersion, String> values = new EnumMap<ICalVersion, String>(ICalVersion.class);
values.put(ICalVersion.V1_0, "FYI");
values.put(ICalVersion.V2_0_DEPRECATED, "NON-PARTICIPANT");
values.put(ICalVersion.V2_0, values.get(ICalVersion.V2_0_DEPRECATED));
Expand All @@ -103,7 +103,7 @@ private ParticipationLevel(Map<ICalVersion, String> values) {
}

private ParticipationLevel(String value) {
Map<ICalVersion, String> values = new HashMap<ICalVersion, String>();
Map<ICalVersion, String> values = new EnumMap<ICalVersion, String>(ICalVersion.class);
for (ICalVersion version : ICalVersion.values()) {
values.put(version, value);
}
Expand Down

0 comments on commit f36e91c

Please sign in to comment.