Gets the value from an entry. Returns null if the entry is invalid, partially-collected, loading, or expired. Unlike Segment#getLiveValue this method does not attempt to cleanup stale entries. As such it should only be called outside of a segment context, such as during iteration.
(ReferenceEntry<K, V> entry, long now)
| 1958 | */ |
| 1959 | |
| 1960 | @Nullable |
| 1961 | V getLiveValue(ReferenceEntry<K, V> entry, long now) { |
| 1962 | if (entry.getKey() == null) { |
| 1963 | return null; |
| 1964 | } |
| 1965 | V value = entry.getValueReference().get(); |
| 1966 | if (value == null) { |
| 1967 | return null; |
| 1968 | } |
| 1969 | if (isExpired(entry, now)) { |
| 1970 | return null; |
| 1971 | } |
| 1972 | return value; |
| 1973 | } |
| 1974 | |
| 1975 | // expiration |
| 1976 |
no test coverage detected