Пример #1
0
 @Override
 public boolean equals(@Nullable Object obj) {
   if (this == obj) {
     return true;
   }
   if (!(obj instanceof CacheBuilderSpec)) {
     return false;
   }
   CacheBuilderSpec that = (CacheBuilderSpec) obj;
   return Objects.equal(initialCapacity, that.initialCapacity)
       && Objects.equal(maximumSize, that.maximumSize)
       && Objects.equal(maximumWeight, that.maximumWeight)
       && Objects.equal(concurrencyLevel, that.concurrencyLevel)
       && Objects.equal(keyStrength, that.keyStrength)
       && Objects.equal(valueStrength, that.valueStrength)
       && Objects.equal(recordStats, that.recordStats)
       && Objects.equal(
           durationInNanos(writeExpirationDuration, writeExpirationTimeUnit),
           durationInNanos(that.writeExpirationDuration, that.writeExpirationTimeUnit))
       && Objects.equal(
           durationInNanos(accessExpirationDuration, accessExpirationTimeUnit),
           durationInNanos(that.accessExpirationDuration, that.accessExpirationTimeUnit))
       && Objects.equal(
           durationInNanos(refreshDuration, refreshTimeUnit),
           durationInNanos(that.refreshDuration, that.refreshTimeUnit));
 }
Пример #2
0
 @Override
 public boolean equals(Object obj) {
   if (obj instanceof GenericArrayType) {
     GenericArrayType that = (GenericArrayType) obj;
     return Objects.equal(getGenericComponentType(), that.getGenericComponentType());
   }
   return false;
 }
Пример #3
0
 /**
  * A sensible definition of {@link #remove} in terms of {@link #iterator}, using the iterator's
  * {@code remove} method. If you override {@link #iterator}, you may wish to override {@link
  * #remove} to forward to this implementation.
  *
  * @since 7.0
  */
 protected boolean standardRemove(@Nullable Object object) {
   Iterator<E> iterator = iterator();
   while (iterator.hasNext()) {
     if (Objects.equal(iterator.next(), object)) {
       iterator.remove();
       return true;
     }
   }
   return false;
 }
Пример #4
0
 @Override
 public boolean equals(Object other) {
   if (!(other instanceof ParameterizedType)) {
     return false;
   }
   ParameterizedType that = (ParameterizedType) other;
   return getRawType().equals(that.getRawType())
       && Objects.equal(getOwnerType(), that.getOwnerType())
       && Arrays.equals(getActualTypeArguments(), that.getActualTypeArguments());
 }
Пример #5
0
 @Override
 public int hashCode() {
   return Objects.hashCode(
       initialCapacity,
       maximumSize,
       maximumWeight,
       concurrencyLevel,
       keyStrength,
       valueStrength,
       recordStats,
       durationInNanos(writeExpirationDuration, writeExpirationTimeUnit),
       durationInNanos(accessExpirationDuration, accessExpirationTimeUnit),
       durationInNanos(refreshDuration, refreshTimeUnit));
 }