K
- Key type
V
- Value type
public interface MultiValued<K,V>
Modifier and Type | Method and Description |
---|---|
Map<K,List<V>> |
allValues()
Get all values.
|
V |
firstValue(K key)
Get first value, ensuring there's one.
|
Optional<V> |
firstValueOptional(K key)
Get first value.
|
Map<K,V> |
firstValues()
Get all first values.
|
boolean |
has(K key)
Check if this MultiValued has at least one value for a given key.
|
boolean |
isEmpty()
Check if this MultiValued has any value.
|
Set<K> |
keys()
Get all keys.
|
V |
lastValue(K key)
Get last value, ensuring there's one.
|
Optional<V> |
lastValueOptional(K key)
Get last value.
|
Map<K,V> |
lastValues()
Get all last values.
|
V |
singleValue(K key)
Get single value, ensuring it has only one value.
|
Optional<V> |
singleValueOptional(K key)
Get single value.
|
Map<K,V> |
singleValues()
Get all single values, ensuring each has only one value.
|
List<V> |
values(K key)
Get all values.
|
boolean isEmpty()
boolean has(K key)
key
- Key
V singleValue(K key) throws MultiValuedConstraintException
key
- Key
MultiValuedConstraintException
- if there is no or multiple values for this key
V firstValue(K key) throws MultiValuedConstraintException
key
- Key
MultiValuedConstraintException
- if there are no value for this key
V lastValue(K key) throws MultiValuedConstraintException
key
- Key
MultiValuedConstraintException
- if there are no value for this key
Optional<V> singleValueOptional(K key)
key
- Key
Optional<V> firstValueOptional(K key)
key
- Key
Optional<V> lastValueOptional(K key)
key
- Key
List<V> values(K key)
key
- Key
Map<K,V> singleValues() throws MultiValuedConstraintException
MultiValuedConstraintException
- if there is no or multiple values for any key
Map<K,V> firstValues()
Map<K,V> lastValues()