private static String buildErrorMessageTemplate(final TimeUnit precision) { String fields = ""; String lastField = ""; if (precision.equals(TimeUnit.HOURS)) { lastField = "day"; } else if (precision.equals(TimeUnit.MINUTES)) { fields = ", day"; lastField = "hour"; } else if (precision.equals(TimeUnit.SECONDS)) { fields = ", day, hour"; lastField = "minute"; } else if (precision.equals(TimeUnit.MILLISECONDS)) { fields = ", day, hour, minute"; lastField = "second"; } return "%nExpecting:%n <%s>%nto have same year, month" + fields + " and " + lastField + " as:%n <%s>%nbut had " + "not."; }
private static String buildErrorMessageTemplate(final TimeUnit precision) { String fields = ""; String lastField = ""; if (precision.equals(TimeUnit.HOURS)) { lastField = "day"; } else if (precision.equals(TimeUnit.MINUTES)) { fields = ", day"; lastField = "hour"; } else if (precision.equals(TimeUnit.SECONDS)) { fields = ", day, hour"; lastField = "minute"; } else if (precision.equals(TimeUnit.MILLISECONDS)) { fields = ", day, hour, minute"; lastField = "second"; } return "%nExpecting:%n <%s>%nto have same year, month" + fields + " and " + lastField + " as:%n <%s>%nbut had " + "not."; }
private String toQueryParamUnit(TimeUnit unit) { for (Map.Entry<String, TimeUnit> entry : TIME_UNIT_MAP.entrySet()) { if (entry.getValue().equals(unit)) { return entry.getKey(); } } return ""; }
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof TCPSSLOptions)) return false; if (!super.equals(o)) return false; TCPSSLOptions that = (TCPSSLOptions) o; if (idleTimeout != that.idleTimeout) return false; if (idleTimeoutUnit != null ? !idleTimeoutUnit.equals(that.idleTimeoutUnit) : that.idleTimeoutUnit != null) return false; if (soLinger != that.soLinger) return false; if (ssl != that.ssl) return false; if (tcpKeepAlive != that.tcpKeepAlive) return false; if (tcpNoDelay != that.tcpNoDelay) return false; if (tcpFastOpen != that.tcpFastOpen) return false; if (tcpQuickAck != that.tcpQuickAck) return false; if (tcpCork != that.tcpCork) return false; if (usePooledBuffers != that.usePooledBuffers) return false; if (crlPaths != null ? !crlPaths.equals(that.crlPaths) : that.crlPaths != null) return false; if (crlValues != null ? !crlValues.equals(that.crlValues) : that.crlValues != null) return false; if (enabledCipherSuites != null ? !enabledCipherSuites.equals(that.enabledCipherSuites) : that.enabledCipherSuites != null) return false; if (keyCertOptions != null ? !keyCertOptions.equals(that.keyCertOptions) : that.keyCertOptions != null) return false; if (trustOptions != null ? !trustOptions.equals(that.trustOptions) : that.trustOptions != null) return false; if (useAlpn != that.useAlpn) return false; if (sslEngineOptions != null ? !sslEngineOptions.equals(that.sslEngineOptions) : that.sslEngineOptions != null) return false; if (!enabledSecureTransportProtocols.equals(that.enabledSecureTransportProtocols)) return false; return true; }
/** * {@inheritDoc} */ @Override public boolean equals(Object obj) { if (!(obj instanceof StatsTimer)) { return false; } final StatsTimer m = (StatsTimer) obj; return super.equals(obj) && timeUnit.equals(m.timeUnit); }
@Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SchedulerCall that = (SchedulerCall) o; return delay == that.delay && callable == that.callable && unit.equals(that.unit); }
public void potentiallyUsePsetEx(RedisConnection connection) { if (!TimeUnit.MILLISECONDS.equals(unit) || !failsafeInvokePsetEx(connection)) { connection.setEx(rawKey, TimeoutUtils.toSeconds(timeout, unit), rawValue); } }
/** * {@inheritDoc} */ @Override public boolean equals(Object obj) { if (obj == null || !(obj instanceof BucketTimer)) { return false; } BucketTimer m = (BucketTimer) obj; return config.equals(m.getConfig()) && bucketConfig.equals(m.bucketConfig) && timeUnit.equals(m.timeUnit) && totalTime.equals(m.totalTime) && min.equals(m.min) && max.equals(m.max) && overflowCount.equals(m.overflowCount) && Arrays.equals(bucketCount, m.bucketCount); }
if (receiver.get().equals(convertTo)) { SuggestedFix fix = replaceTreeWith(tree, convertTo, state.getSourceForNode(arg0)); return describeMatch(tree, fix);
@Override public long getReadTimeout(TimeUnit unit) { return socketTimeoutUnits.equals(unit) ? socketTimeout : unit.convert(socketTimeout, socketTimeoutUnits); }
@Override public long getConnectionCheckoutTimeout(TimeUnit unit) { return TimeUnit.MILLISECONDS.equals(unit) ? connectionCheckoutTimeoutMs : unit.convert(connectionCheckoutTimeoutMs, TimeUnit.MILLISECONDS); }
@Override public long getConnectionTTL(TimeUnit unit) { return connectionTTLUnit.equals(unit) ? connectionTTL : unit.convert(connectionTTL, connectionTTLUnit); }
@Override public long getConnectionTimeout(TimeUnit unit) { return establishConnectionTimeoutUnits.equals(unit) ? establishConnectionTimeout : unit.convert(establishConnectionTimeout, establishConnectionTimeoutUnits); }
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof TCPSSLOptions)) return false; if (!super.equals(o)) return false; TCPSSLOptions that = (TCPSSLOptions) o; if (idleTimeout != that.idleTimeout) return false; if (idleTimeoutUnit != null ? !idleTimeoutUnit.equals(that.idleTimeoutUnit) : that.idleTimeoutUnit != null) return false; if (soLinger != that.soLinger) return false; if (ssl != that.ssl) return false; if (tcpKeepAlive != that.tcpKeepAlive) return false; if (tcpNoDelay != that.tcpNoDelay) return false; if (tcpFastOpen != that.tcpFastOpen) return false; if (tcpQuickAck != that.tcpQuickAck) return false; if (tcpCork != that.tcpCork) return false; if (usePooledBuffers != that.usePooledBuffers) return false; if (crlPaths != null ? !crlPaths.equals(that.crlPaths) : that.crlPaths != null) return false; if (crlValues != null ? !crlValues.equals(that.crlValues) : that.crlValues != null) return false; if (enabledCipherSuites != null ? !enabledCipherSuites.equals(that.enabledCipherSuites) : that.enabledCipherSuites != null) return false; if (keyCertOptions != null ? !keyCertOptions.equals(that.keyCertOptions) : that.keyCertOptions != null) return false; if (trustOptions != null ? !trustOptions.equals(that.trustOptions) : that.trustOptions != null) return false; if (useAlpn != that.useAlpn) return false; if (sslEngineOptions != null ? !sslEngineOptions.equals(that.sslEngineOptions) : that.sslEngineOptions != null) return false; if (!enabledSecureTransportProtocols.equals(that.enabledSecureTransportProtocols)) return false; return true; }
@Override public boolean equals (final Object o) { if (o == this) return true; if (!(o instanceof TimeValue)) return false; final TimeValue rhs = (TimeValue) o; return m_eTimeUnit.equals (rhs.m_eTimeUnit) && m_nDuration == rhs.m_nDuration; }
public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof Duration) { Duration d = (Duration) o; return this.value == d.value && this.timeUnit.equals(d.timeUnit); } return false; }
private String toQueryParamUnit(TimeUnit unit) { for (Map.Entry<String, TimeUnit> entry : TIME_UNIT_MAP.entrySet()) { if (entry.getValue().equals(unit)) { return entry.getKey(); } } return ""; }
private Duration(long length, TimeUnit timeUnit) { this.length = length; this.timeUnit = Assert.notNull(timeUnit, "timeUnit"); finite = length == Long.MAX_VALUE && TimeUnit.DAYS.equals(timeUnit) ? false : true; }
/** * {@inheritDoc} */ @Override public boolean equals(Object obj) { if (!(obj instanceof StatsTimer)) { return false; } final StatsTimer m = (StatsTimer) obj; return super.equals(obj) && timeUnit.equals(m.timeUnit); }
@Override public boolean equals(Object other) { if (other instanceof Timeout) return getTime() == ((Timeout) other).getTime() && getUnit().equals(((Timeout) other).getUnit()); return false; }