Commit 6dbdb1d8 by Gregor Zurowski Committed by Spencer Gibb

Remove commons-lang builders (#2243)

This commit removes usages of commons-lang builders for equals, hashCode and toString methods. Signed-off-by: 's avatarGregor Zurowski <gregor@zurowski.org>
parent ea5585e3
...@@ -16,23 +16,24 @@ ...@@ -16,23 +16,24 @@
package org.springframework.cloud.netflix.eureka.server; package org.springframework.cloud.netflix.eureka.server;
import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Objects;
import java.util.Set; import java.util.Set;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.core.env.PropertyResolver; import org.springframework.core.env.PropertyResolver;
import com.netflix.eureka.EurekaServerConfig; import com.netflix.eureka.EurekaServerConfig;
import com.netflix.eureka.aws.AwsBindingStrategy; import com.netflix.eureka.aws.AwsBindingStrategy;
import org.springframework.core.style.ToStringCreator;
/** /**
* @author Dave Syer * @author Dave Syer
* @author Gregor Zurowski
*/ */
@ConfigurationProperties(EurekaServerConfigBean.PREFIX) @ConfigurationProperties(EurekaServerConfigBean.PREFIX)
public class EurekaServerConfigBean implements EurekaServerConfig { public class EurekaServerConfigBean implements EurekaServerConfig {
...@@ -919,19 +920,203 @@ public class EurekaServerConfigBean implements EurekaServerConfig { ...@@ -919,19 +920,203 @@ public class EurekaServerConfigBean implements EurekaServerConfig {
this.minAvailableInstancesForPeerReplication = minAvailableInstancesForPeerReplication; this.minAvailableInstancesForPeerReplication = minAvailableInstancesForPeerReplication;
} }
@Override @Override public boolean equals(Object o) {
public boolean equals(Object o) { if (this == o) return true;
return EqualsBuilder.reflectionEquals(this, o); if (o == null || getClass() != o.getClass()) return false;
EurekaServerConfigBean that = (EurekaServerConfigBean) o;
return aSGCacheExpiryTimeoutMs == that.aSGCacheExpiryTimeoutMs &&
aSGQueryTimeoutMs == that.aSGQueryTimeoutMs &&
aSGUpdateIntervalMs == that.aSGUpdateIntervalMs &&
Objects.equals(aWSAccessId, that.aWSAccessId) &&
Objects.equals(aWSSecretKey, that.aWSSecretKey) &&
batchReplication == that.batchReplication &&
bindingStrategy == that.bindingStrategy &&
deltaRetentionTimerIntervalInMs == that.deltaRetentionTimerIntervalInMs &&
disableDelta == that.disableDelta &&
disableDeltaForRemoteRegions == that.disableDeltaForRemoteRegions &&
disableTransparentFallbackToOtherRegion == that.disableTransparentFallbackToOtherRegion &&
eIPBindingRetryIntervalMs == that.eIPBindingRetryIntervalMs &&
eIPBindingRetryIntervalMsWhenUnbound == that.eIPBindingRetryIntervalMsWhenUnbound &&
eIPBindRebindRetries == that.eIPBindRebindRetries &&
enableReplicatedRequestCompression == that.enableReplicatedRequestCompression &&
enableSelfPreservation == that.enableSelfPreservation &&
evictionIntervalTimerInMs == that.evictionIntervalTimerInMs &&
gZipContentFromRemoteRegion == that.gZipContentFromRemoteRegion &&
Objects.equals(jsonCodecName, that.jsonCodecName) &&
Objects.equals(listAutoScalingGroupsRoleName, that.listAutoScalingGroupsRoleName) &&
logIdentityHeaders == that.logIdentityHeaders &&
maxElementsInPeerReplicationPool == that.maxElementsInPeerReplicationPool &&
maxElementsInStatusReplicationPool == that.maxElementsInStatusReplicationPool &&
maxIdleThreadAgeInMinutesForPeerReplication == that.maxIdleThreadAgeInMinutesForPeerReplication &&
maxIdleThreadInMinutesAgeForStatusReplication == that.maxIdleThreadInMinutesAgeForStatusReplication &&
maxThreadsForPeerReplication == that.maxThreadsForPeerReplication &&
maxThreadsForStatusReplication == that.maxThreadsForStatusReplication &&
maxTimeForReplication == that.maxTimeForReplication &&
minAvailableInstancesForPeerReplication == that.minAvailableInstancesForPeerReplication &&
minThreadsForPeerReplication == that.minThreadsForPeerReplication &&
minThreadsForStatusReplication == that.minThreadsForStatusReplication &&
numberOfReplicationRetries == that.numberOfReplicationRetries &&
peerEurekaNodesUpdateIntervalMs == that.peerEurekaNodesUpdateIntervalMs &&
peerEurekaStatusRefreshTimeIntervalMs == that.peerEurekaStatusRefreshTimeIntervalMs &&
peerNodeConnectionIdleTimeoutSeconds == that.peerNodeConnectionIdleTimeoutSeconds &&
peerNodeConnectTimeoutMs == that.peerNodeConnectTimeoutMs &&
peerNodeReadTimeoutMs == that.peerNodeReadTimeoutMs &&
peerNodeTotalConnections == that.peerNodeTotalConnections &&
peerNodeTotalConnectionsPerHost == that.peerNodeTotalConnectionsPerHost &&
primeAwsReplicaConnections == that.primeAwsReplicaConnections &&
Objects.equals(propertyResolver, that.propertyResolver) &&
rateLimiterBurstSize == that.rateLimiterBurstSize &&
rateLimiterEnabled == that.rateLimiterEnabled &&
rateLimiterFullFetchAverageRate == that.rateLimiterFullFetchAverageRate &&
Objects.equals(rateLimiterPrivilegedClients, that.rateLimiterPrivilegedClients) &&
rateLimiterRegistryFetchAverageRate == that.rateLimiterRegistryFetchAverageRate &&
rateLimiterThrottleStandardClients == that.rateLimiterThrottleStandardClients &&
registrySyncRetries == that.registrySyncRetries &&
registrySyncRetryWaitMs == that.registrySyncRetryWaitMs &&
Objects.equals(remoteRegionAppWhitelist, that.remoteRegionAppWhitelist) &&
remoteRegionConnectionIdleTimeoutSeconds == that.remoteRegionConnectionIdleTimeoutSeconds &&
remoteRegionConnectTimeoutMs == that.remoteRegionConnectTimeoutMs &&
remoteRegionFetchThreadPoolSize == that.remoteRegionFetchThreadPoolSize &&
remoteRegionReadTimeoutMs == that.remoteRegionReadTimeoutMs &&
remoteRegionRegistryFetchInterval == that.remoteRegionRegistryFetchInterval &&
remoteRegionTotalConnections == that.remoteRegionTotalConnections &&
remoteRegionTotalConnectionsPerHost == that.remoteRegionTotalConnectionsPerHost &&
Objects.equals(remoteRegionTrustStore, that.remoteRegionTrustStore) &&
Objects.equals(remoteRegionTrustStorePassword, that.remoteRegionTrustStorePassword) &&
Arrays.equals(remoteRegionUrls, that.remoteRegionUrls) &&
Objects.equals(remoteRegionUrlsWithName, that.remoteRegionUrlsWithName) &&
Double.compare(that.renewalPercentThreshold, renewalPercentThreshold) == 0 &&
renewalThresholdUpdateIntervalMs == that.renewalThresholdUpdateIntervalMs &&
responseCacheAutoExpirationInSeconds == that.responseCacheAutoExpirationInSeconds &&
responseCacheUpdateIntervalMs == that.responseCacheUpdateIntervalMs &&
retentionTimeInMSInDeltaQueue == that.retentionTimeInMSInDeltaQueue &&
route53BindingRetryIntervalMs == that.route53BindingRetryIntervalMs &&
route53BindRebindRetries == that.route53BindRebindRetries &&
route53DomainTTL == that.route53DomainTTL &&
syncWhenTimestampDiffers == that.syncWhenTimestampDiffers &&
useReadOnlyResponseCache == that.useReadOnlyResponseCache &&
waitTimeInMsWhenSyncEmpty == that.waitTimeInMsWhenSyncEmpty &&
Objects.equals(xmlCodecName, that.xmlCodecName);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return HashCodeBuilder.reflectionHashCode(this); return Objects.hash(aSGCacheExpiryTimeoutMs, aSGQueryTimeoutMs,
aSGUpdateIntervalMs, aWSAccessId, aWSSecretKey, batchReplication,
bindingStrategy, deltaRetentionTimerIntervalInMs, disableDelta,
disableDeltaForRemoteRegions,
disableTransparentFallbackToOtherRegion, eIPBindRebindRetries,
eIPBindingRetryIntervalMs, eIPBindingRetryIntervalMsWhenUnbound,
enableReplicatedRequestCompression, enableSelfPreservation,
evictionIntervalTimerInMs, gZipContentFromRemoteRegion,
jsonCodecName, listAutoScalingGroupsRoleName, logIdentityHeaders,
maxElementsInPeerReplicationPool, maxElementsInStatusReplicationPool,
maxIdleThreadAgeInMinutesForPeerReplication,
maxIdleThreadInMinutesAgeForStatusReplication,
maxThreadsForPeerReplication, maxThreadsForStatusReplication,
maxTimeForReplication, minAvailableInstancesForPeerReplication,
minThreadsForPeerReplication, minThreadsForStatusReplication,
numberOfReplicationRetries, peerEurekaNodesUpdateIntervalMs,
peerEurekaStatusRefreshTimeIntervalMs, peerNodeConnectTimeoutMs,
peerNodeConnectionIdleTimeoutSeconds, peerNodeReadTimeoutMs,
peerNodeTotalConnections, peerNodeTotalConnectionsPerHost,
primeAwsReplicaConnections, propertyResolver, rateLimiterBurstSize,
rateLimiterEnabled, rateLimiterFullFetchAverageRate,
rateLimiterPrivilegedClients, rateLimiterRegistryFetchAverageRate,
rateLimiterThrottleStandardClients, registrySyncRetries,
registrySyncRetryWaitMs, remoteRegionAppWhitelist,
remoteRegionConnectTimeoutMs,
remoteRegionConnectionIdleTimeoutSeconds,
remoteRegionFetchThreadPoolSize, remoteRegionReadTimeoutMs,
remoteRegionRegistryFetchInterval, remoteRegionTotalConnections,
remoteRegionTotalConnectionsPerHost, remoteRegionTrustStore,
remoteRegionTrustStorePassword, remoteRegionUrls,
remoteRegionUrlsWithName, renewalPercentThreshold,
renewalThresholdUpdateIntervalMs,
responseCacheAutoExpirationInSeconds,
responseCacheUpdateIntervalMs, retentionTimeInMSInDeltaQueue,
route53BindRebindRetries, route53BindingRetryIntervalMs,
route53DomainTTL, syncWhenTimestampDiffers,
useReadOnlyResponseCache, waitTimeInMsWhenSyncEmpty, xmlCodecName);
} }
@Override @Override
public String toString() { public String toString() {
return ToStringBuilder.reflectionToString(this); return new ToStringCreator(this)
.append("aSGCacheExpiryTimeoutMs", this.aSGCacheExpiryTimeoutMs)
.append("aSGQueryTimeoutMs", this.aSGQueryTimeoutMs)
.append("aSGUpdateIntervalMs", this.aSGUpdateIntervalMs)
.append("aWSAccessId", this.aWSAccessId)
.append("aWSSecretKey", this.aWSSecretKey)
.append("batchReplication", this.batchReplication)
.append("bindingStrategy", this.bindingStrategy)
.append("deltaRetentionTimerIntervalInMs", this.deltaRetentionTimerIntervalInMs)
.append("disableDelta", this.disableDelta)
.append("disableDeltaForRemoteRegions", this.disableDeltaForRemoteRegions)
.append("disableTransparentFallbackToOtherRegion", this.disableTransparentFallbackToOtherRegion)
.append("eIPBindRebindRetries", this.eIPBindRebindRetries)
.append("eIPBindingRetryIntervalMs", this.eIPBindingRetryIntervalMs)
.append("eIPBindingRetryIntervalMsWhenUnbound", this.eIPBindingRetryIntervalMsWhenUnbound)
.append("enableReplicatedRequestCompression", this.enableReplicatedRequestCompression)
.append("enableSelfPreservation", this.enableSelfPreservation)
.append("evictionIntervalTimerInMs", this.evictionIntervalTimerInMs)
.append("gZipContentFromRemoteRegion", this.gZipContentFromRemoteRegion)
.append("jsonCodecName", this.jsonCodecName)
.append("listAutoScalingGroupsRoleName", this.listAutoScalingGroupsRoleName)
.append("logIdentityHeaders", this.logIdentityHeaders)
.append("maxElementsInPeerReplicationPool", this.maxElementsInPeerReplicationPool)
.append("maxElementsInStatusReplicationPool", this.maxElementsInStatusReplicationPool)
.append("maxIdleThreadAgeInMinutesForPeerReplication", this.maxIdleThreadAgeInMinutesForPeerReplication)
.append("maxIdleThreadInMinutesAgeForStatusReplication", this.maxIdleThreadInMinutesAgeForStatusReplication)
.append("maxThreadsForPeerReplication", this.maxThreadsForPeerReplication)
.append("maxThreadsForStatusReplication", this.maxThreadsForStatusReplication)
.append("maxTimeForReplication", this.maxTimeForReplication)
.append("minAvailableInstancesForPeerReplication", this.minAvailableInstancesForPeerReplication)
.append("minThreadsForPeerReplication", this.minThreadsForPeerReplication)
.append("minThreadsForStatusReplication", this.minThreadsForStatusReplication)
.append("numberOfReplicationRetries", this.numberOfReplicationRetries)
.append("peerEurekaNodesUpdateIntervalMs", this.peerEurekaNodesUpdateIntervalMs)
.append("peerEurekaStatusRefreshTimeIntervalMs", this.peerEurekaStatusRefreshTimeIntervalMs)
.append("peerNodeConnectTimeoutMs", this.peerNodeConnectTimeoutMs)
.append("peerNodeConnectionIdleTimeoutSeconds", this.peerNodeConnectionIdleTimeoutSeconds)
.append("peerNodeReadTimeoutMs", this.peerNodeReadTimeoutMs)
.append("peerNodeTotalConnections", this.peerNodeTotalConnections)
.append("peerNodeTotalConnectionsPerHost", this.peerNodeTotalConnectionsPerHost)
.append("primeAwsReplicaConnections", this.primeAwsReplicaConnections)
.append("propertyResolver", this.propertyResolver)
.append("rateLimiterBurstSize", this.rateLimiterBurstSize)
.append("rateLimiterEnabled", this.rateLimiterEnabled)
.append("rateLimiterFullFetchAverageRate", this.rateLimiterFullFetchAverageRate)
.append("rateLimiterPrivilegedClients", this.rateLimiterPrivilegedClients)
.append("rateLimiterRegistryFetchAverageRate", this.rateLimiterRegistryFetchAverageRate)
.append("rateLimiterThrottleStandardClients", this.rateLimiterThrottleStandardClients)
.append("registrySyncRetries", this.registrySyncRetries)
.append("registrySyncRetryWaitMs", this.registrySyncRetryWaitMs)
.append("remoteRegionAppWhitelist", this.remoteRegionAppWhitelist)
.append("remoteRegionConnectTimeoutMs", this.remoteRegionConnectTimeoutMs)
.append("remoteRegionConnectionIdleTimeoutSeconds", this.remoteRegionConnectionIdleTimeoutSeconds)
.append("remoteRegionFetchThreadPoolSize", this.remoteRegionFetchThreadPoolSize)
.append("remoteRegionReadTimeoutMs", this.remoteRegionReadTimeoutMs)
.append("remoteRegionRegistryFetchInterval", this.remoteRegionRegistryFetchInterval)
.append("remoteRegionTotalConnections", this.remoteRegionTotalConnections)
.append("remoteRegionTotalConnectionsPerHost", this.remoteRegionTotalConnectionsPerHost)
.append("remoteRegionTrustStore", this.remoteRegionTrustStore)
.append("remoteRegionTrustStorePassword", this.remoteRegionTrustStorePassword)
.append("remoteRegionUrls", this.remoteRegionUrls)
.append("remoteRegionUrlsWithName", this.remoteRegionUrlsWithName)
.append("renewalPercentThreshold", this.renewalPercentThreshold)
.append("renewalThresholdUpdateIntervalMs", this.renewalThresholdUpdateIntervalMs)
.append("responseCacheAutoExpirationInSeconds", this.responseCacheAutoExpirationInSeconds)
.append("responseCacheUpdateIntervalMs", this.responseCacheUpdateIntervalMs)
.append("retentionTimeInMSInDeltaQueue", this.retentionTimeInMSInDeltaQueue)
.append("route53BindRebindRetries", this.route53BindRebindRetries)
.append("route53BindingRetryIntervalMs", this.route53BindingRetryIntervalMs)
.append("route53DomainTTL", this.route53DomainTTL)
.append("syncWhenTimestampDiffers", this.syncWhenTimestampDiffers)
.append("useReadOnlyResponseCache", this.useReadOnlyResponseCache)
.append("waitTimeInMsWhenSyncEmpty", this.waitTimeInMsWhenSyncEmpty)
.append("xmlCodecName", this.xmlCodecName)
.toString();
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment