Skip to content

Commit

Permalink
Merge pull request #5305 from pizzi80/4.1_mojarra_official_faces_issu…
Browse files Browse the repository at this point in the history
…e_1789

Make FacesMessage#VALUES / VALUES_MAP generic
  • Loading branch information
BalusC authored Sep 2, 2023
2 parents 24724c7 + 0d12516 commit 44fbb76
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
package jakarta.faces.application;

import static java.util.Arrays.stream;
import static java.util.Collections.unmodifiableMap;
import static java.util.stream.Collectors.toMap;
import static java.util.function.Function.identity;
import static java.util.stream.Collectors.toUnmodifiableMap;

import java.io.IOException;
import java.io.ObjectInputStream;
Expand All @@ -28,7 +28,6 @@
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.function.Function;

/**
* <p>
Expand Down Expand Up @@ -138,14 +137,14 @@ public class FacesMessage implements Serializable {
* order of their ordinal value.
* </p>
*/
public static final List VALUES = List.of(values);
public static final List<Severity> VALUES = List.of(values);

/**
* <p>
* Immutable <code>Map</code> of valid {@link jakarta.faces.application.FacesMessage.Severity} instances, keyed by name.
* </p>
*/
public final static Map VALUES_MAP = unmodifiableMap(stream(values).collect(toMap(severity -> severity.severityName , Function.identity())));
public final static Map<String,Severity> VALUES_MAP = stream(values).collect(toUnmodifiableMap(severity -> severity.severityName, identity()));

// ------------------------------------------------------ Instance Variables

Expand Down

0 comments on commit 44fbb76

Please sign in to comment.