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)
| 1963 | */ |
| 1964 | |
| 1965 | @Nullable |
| 1966 | V getLiveValue(ReferenceEntry<K, V> entry, long now) { |
| 1967 | if (entry.getKey() == null) { |
| 1968 | return null; |
| 1969 | } |
| 1970 | V value = entry.getValueReference().get(); |
| 1971 | if (value == null) { |
| 1972 | return null; |
| 1973 | } |
| 1974 | if (isExpired(entry, now)) { |
| 1975 | return null; |
| 1976 | } |
| 1977 | return value; |
| 1978 | } |
| 1979 | |
| 1980 | // expiration |
| 1981 |
no test coverage detected