Gets the value from an entry. Returns null if the entry is invalid, partially-collected, loading, or expired. Unlike {@link Segment#getLiveValue} this method does not attempt to clean up stale entries. As such it should only be called outside a segment context, such as during iteration.
(ReferenceEntry<K, V> entry, long now)
| 1773 | * iteration. |
| 1774 | */ |
| 1775 | @Nullable V getLiveValue(ReferenceEntry<K, V> entry, long now) { |
| 1776 | if (entry.getKey() == null) { |
| 1777 | return null; |
| 1778 | } |
| 1779 | V value = entry.getValueReference().get(); |
| 1780 | if (value == null) { |
| 1781 | return null; |
| 1782 | } |
| 1783 | |
| 1784 | if (isExpired(entry, now)) { |
| 1785 | return null; |
| 1786 | } |
| 1787 | return value; |
| 1788 | } |
| 1789 | |
| 1790 | // expiration |
| 1791 |
no test coverage detected