public static interface EntryView.ReadEntryView<K,V> extends MetaParam.Lookup
MetaParam
information.
It exposes both get()
and find()
methods for
convenience. If the caller knows for sure that the value will be
present, get()
offers the convenience of retrieving the value
directly without having to get an Optional
first. As a result
of this, get()
throws NoSuchElementException
if
there's no value associated with the entry. If the caller is unsure
of whether the value is present, find()
should be used.
This approach avoids the user having to do null checks.
Modifier and Type | Method and Description |
---|---|
Optional<V> |
find()
Optional value.
|
V |
get()
Returns a non-null value if the key has a value associated with it or
throws
NoSuchElementException if no value is associated with
the. |
K |
key()
Key of the read-only entry view.
|
findMetaParam
K key()
V get() throws NoSuchElementException
NoSuchElementException
if no value is associated with
the.NoSuchElementException
- if no value is associated with the key.Copyright © 2017 JBoss, a division of Red Hat. All rights reserved.