1 package org.onap.vid.utils;
3 import com.fasterxml.jackson.annotation.JsonPropertyOrder;
5 import java.util.Collection;
6 import java.util.function.Function;
8 import static java.util.stream.Collectors.toSet;
10 @JsonPropertyOrder({"keyType", "valuesType"})
11 public class Multival<K, V> {
12 private final String keyType;
13 private final String valuesType;
15 private final Collection<V> values;
17 private Multival(String keyType, K key, String valuesType, Collection<V> values) {
18 this.keyType = keyType;
20 this.valuesType = valuesType;
24 public static <K, V> Multival<K, V> of(String keyType, K key, String valuesType, Collection<V> values) {
25 return new Multival<>(keyType, key, valuesType, values);
28 public String getKeyType() {
32 public String getValuesType() {
40 public Collection<V> getValues() {
44 public <W> Multival<K, W> mapEachVal(Function<V, W> mapper) {
49 this.getValues().stream()