/** * Return the value from a possibly null entry. * * @param entry An entry, which may be null * @return The value for entry or null if the entry is null */ private V getValueSafe(final TimestampedValue<V> entry) { return entry == null ? null : entry.getValue(); }
/** * Return the value from a possibly null entry. * * @param entry An entry, which may be null * @return The value for entry or null if the entry is null */ private V getValueSafe(final TimestampedValue<V> entry) { return entry == null ? null : entry.getValue(); }
/** * Return the value from a possibly null entry. * * @param entry An entry, which may be null * @return The value for entry or null if the entry is null */ private V getValueSafe(final TimestampedValue<V> entry) { return entry == null ? null : entry.getValue(); }
/** * Return the value from a possibly null entry. * * @param entry An entry, which may be null * @return The value for entry or null if the entry is null */ private V getValueSafe(final TimestampedValue<V> entry) { return entry == null ? null : entry.getValue(); }
/** * Compare whether the value in this entry equals the value in another entry. Timestamps are ignored for equality * purposes. Two null values will compare equals. */ @Override public boolean equals(final Object obj) { if (obj == this) { return true; } else if (obj instanceof AbstractTimestampedValue) { TimestampedValue<V> other = (TimestampedValue<V>) obj; V thisValue = getValue(); if (other.getValue() == null) { if (thisValue == null) { return true; } } else if (thisValue != null) { return other.getValue().equals(thisValue); } } return false; }
/** * Compare whether the value in this entry equals the value in another entry. Timestamps are ignored for equality * purposes. Two null values will compare equals. */ @Override public boolean equals(final Object obj) { if (obj == this) { return true; } else if (obj instanceof AbstractTimestampedValue) { final TimestampedValue<V> other = (TimestampedValue<V>) obj; final V thisValue = getValue(); if (other.getValue() == null) { if (thisValue == null) { return true; } } else if (thisValue != null) { return other.getValue().equals(thisValue); } } return false; }
/** * Compare whether the value in this entry equals the value in another entry. Timestamps are ignored for equality * purposes. Two null values will compare equals. */ @Override public boolean equals(final Object obj) { if (obj == this) { return true; } else if (obj instanceof AbstractTimestampedValue) { final TimestampedValue<V> other = (TimestampedValue<V>) obj; final V thisValue = getValue(); if (other.getValue() == null) { if (thisValue == null) { return true; } } else if (thisValue != null) { return other.getValue().equals(thisValue); } } return false; }
/** * Compare whether the value in this entry equals the value in another entry. Timestamps are ignored for equality * purposes. Two null values will compare equals. */ @Override public boolean equals(final Object obj) { if (obj == this) { return true; } else if (obj instanceof AbstractTimestampedValue) { final TimestampedValue<V> other = (TimestampedValue<V>) obj; final V thisValue = getValue(); if (other.getValue() == null) { if (thisValue == null) { return true; } } else if (thisValue != null) { return other.getValue().equals(thisValue); } } return false; }
private V getValueSafe(final TimestampedValue<V> entry) { return entry == null ? null : entry.isExpired(getTime(), config) ? null : entry.getValue(); }
private V getValueSafe(final TimestampedValue<V> entry) { return entry == null ? null : entry.isExpired(getTime(), config) ? null : entry.getValue(); }
private V getValueSafe(final TimestampedValue<V> entry) { return entry == null ? null : entry.isExpired(getTime(), config) ? null : entry.getValue(); }
private V getValueSafe(final TimestampedValue<V> entry) { return entry == null ? null : entry.isExpired(getTime(), config) ? null : entry.getValue(); }
/** * Evict an item from the cache due to expiration. The caller is responsible for determining whether the entry has * expired. This method will log the eviction (if logging is enabled) and remove the entry. */ private void evict(final K key, final TimestampedValue<V> entry, final int now) { Assert.pre(key != null); if (this.data.remove(key, entry)) { onEvict(key, entry.getValue()); logEviction(key, entry, now); } }