Skip to content

Commit

Permalink
Remove equals, canEqual, hashCode, toString from configurations
Browse files Browse the repository at this point in the history
Only getters and setters are sufficient in configuration classes.
  • Loading branch information
ebyhr committed Jan 4, 2024
1 parent 0a62331 commit 8d33156
Show file tree
Hide file tree
Showing 14 changed files with 0 additions and 996 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
*/
package io.trino.gateway.ha.config;

import java.util.Objects;

public class AuthenticationConfiguration
{
private String defaultType;
Expand Down Expand Up @@ -59,58 +57,4 @@ public void setForm(FormAuthConfiguration form)
{
this.form = form;
}

public boolean equals(final Object o)
{
if (o == this) {
return true;
}
if (!(o instanceof AuthenticationConfiguration other)) {
return false;
}
if (!other.canEqual(this)) {
return false;
}
final Object defaultType = this.getDefaultType();
final Object otherDefaultType = other.getDefaultType();
if (!Objects.equals(defaultType, otherDefaultType)) {
return false;
}
final Object oauth = this.getOauth();
final Object otherOauth = other.getOauth();
if (!Objects.equals(oauth, otherOauth)) {
return false;
}
final Object form = this.getForm();
final Object otherForm = other.getForm();
return Objects.equals(form, otherForm);
}

protected boolean canEqual(final Object other)
{
return other instanceof AuthenticationConfiguration;
}

public int hashCode()
{
final int prime = 59;
int result = 1;
final Object defaultType = this.getDefaultType();
result = result * prime + (defaultType == null ? 43 : defaultType.hashCode());
final Object oauth = this.getOauth();
result = result * prime + (oauth == null ? 43 : oauth.hashCode());
final Object form = this.getForm();
result = result * prime + (form == null ? 43 : form.hashCode());
return result;
}

@Override
public String toString()
{
return "AuthenticationConfiguration{" +
"defaultType='" + defaultType + '\'' +
", oauth=" + oauth +
", form=" + form +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
*/
package io.trino.gateway.ha.config;

import java.util.Objects;

public class AuthorizationConfiguration
{
private String admin;
Expand Down Expand Up @@ -71,66 +69,4 @@ public void setLdapConfigPath(String ldapConfigPath)
{
this.ldapConfigPath = ldapConfigPath;
}

public boolean equals(final Object o)
{
if (o == this) {
return true;
}
if (!(o instanceof AuthorizationConfiguration other)) {
return false;
}
if (!other.canEqual(this)) {
return false;
}
final Object admin = this.getAdmin();
final Object otherAdmin = other.getAdmin();
if (!Objects.equals(admin, otherAdmin)) {
return false;
}
final Object user = this.getUser();
final Object otherUser = other.getUser();
if (!Objects.equals(user, otherUser)) {
return false;
}
final Object api = this.getApi();
final Object otherApi = other.getApi();
if (!Objects.equals(api, otherApi)) {
return false;
}
final Object ldapConfigPath = this.getLdapConfigPath();
final Object otherLdapConfigPath = other.getLdapConfigPath();
return Objects.equals(ldapConfigPath, otherLdapConfigPath);
}

protected boolean canEqual(final Object other)
{
return other instanceof AuthorizationConfiguration;
}

public int hashCode()
{
final int prime = 59;
int result = 1;
final Object admin = this.getAdmin();
result = result * prime + (admin == null ? 43 : admin.hashCode());
final Object user = this.getUser();
result = result * prime + (user == null ? 43 : user.hashCode());
final Object api = this.getApi();
result = result * prime + (api == null ? 43 : api.hashCode());
final Object ldapConfigPath = this.getLdapConfigPath();
result = result * prime + (ldapConfigPath == null ? 43 : ldapConfigPath.hashCode());
return result;
}

@Override
public String toString()
{
return "AuthorizationConfiguration{" +
"admin='" + admin + '\'' +
", user='" + user + '\'' +
", api='" + api + '\'' +
", ldapConfigPath='" + ldapConfigPath + '\'' +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
*/
package io.trino.gateway.ha.config;

import java.util.Objects;

public class BackendStateConfiguration
{
private String username;
Expand Down Expand Up @@ -52,58 +50,4 @@ public void setSsl(Boolean ssl)
{
this.ssl = ssl;
}

public boolean equals(final Object o)
{
if (o == this) {
return true;
}
if (!(o instanceof BackendStateConfiguration other)) {
return false;
}
if (!other.canEqual(this)) {
return false;
}
final Object username = this.getUsername();
final Object otherUsername = other.getUsername();
if (!Objects.equals(username, otherUsername)) {
return false;
}
final Object password = this.getPassword();
final Object otherPassword = other.getPassword();
if (!Objects.equals(password, otherPassword)) {
return false;
}
final Object ssl = this.getSsl();
final Object otherSsl = other.getSsl();
return Objects.equals(ssl, otherSsl);
}

protected boolean canEqual(final Object other)
{
return other instanceof BackendStateConfiguration;
}

public int hashCode()
{
final int prime = 59;
int result = 1;
final Object username = this.getUsername();
result = result * prime + (username == null ? 43 : username.hashCode());
final Object password = this.getPassword();
result = result * prime + (password == null ? 43 : password.hashCode());
final Object ssl = this.getSsl();
result = result * prime + (ssl == null ? 43 : ssl.hashCode());
return result;
}

@Override
public String toString()
{
return "BackendStateConfiguration{" +
"username='" + username + '\'' +
", password='" + password + '\'' +
", ssl=" + ssl +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,37 +28,4 @@ public void setUseApi(boolean useApi)
{
this.useApi = useApi;
}

public boolean equals(final Object o)
{
if (o == this) {
return true;
}
if (!(o instanceof ClusterStatsConfiguration other)) {
return false;
}
if (!other.canEqual(this)) {
return false;
}
return this.isUseApi() == other.isUseApi();
}

protected boolean canEqual(final Object other)
{
return other instanceof ClusterStatsConfiguration;
}

public int hashCode()
{
final int prime = 59;
int result = 1;
result = result * prime + (this.isUseApi() ? 79 : 97);
return result;
}

@Override
public String toString()
{
return "ClusterStatsConfiguration{" + "useApi=" + useApi + '}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
*/
package io.trino.gateway.ha.config;

import java.util.Objects;

public class DataStoreConfiguration
{
private String jdbcUrl;
Expand Down Expand Up @@ -83,74 +81,4 @@ public void setQueryHistoryHoursRetention(Integer queryHistoryHoursRetention)
{
this.queryHistoryHoursRetention = queryHistoryHoursRetention;
}

public boolean equals(final Object o)
{
if (o == this) {
return true;
}
if (!(o instanceof DataStoreConfiguration other)) {
return false;
}
if (!other.canEqual(this)) {
return false;
}
final Object jdbcUrl = this.getJdbcUrl();
final Object otherJdbcUrl = other.getJdbcUrl();
if (!Objects.equals(jdbcUrl, otherJdbcUrl)) {
return false;
}
final Object user = this.getUser();
final Object otherUser = other.getUser();
if (!Objects.equals(user, otherUser)) {
return false;
}
final Object password = this.getPassword();
final Object otherPassword = other.getPassword();
if (!Objects.equals(password, otherPassword)) {
return false;
}
final Object driver = this.getDriver();
final Object otherDriver = other.getDriver();
if (!Objects.equals(driver, otherDriver)) {
return false;
}
final Object queryHistoryHoursRetention = this.getQueryHistoryHoursRetention();
final Object otherQueryHistoryHoursRetention = other.getQueryHistoryHoursRetention();
return Objects.equals(queryHistoryHoursRetention, otherQueryHistoryHoursRetention);
}

protected boolean canEqual(final Object other)
{
return other instanceof DataStoreConfiguration;
}

public int hashCode()
{
final int prime = 59;
int result = 1;
final Object jdbcUrl = this.getJdbcUrl();
result = result * prime + (jdbcUrl == null ? 43 : jdbcUrl.hashCode());
final Object user = this.getUser();
result = result * prime + (user == null ? 43 : user.hashCode());
final Object password = this.getPassword();
result = result * prime + (password == null ? 43 : password.hashCode());
final Object driver = this.getDriver();
result = result * prime + (driver == null ? 43 : driver.hashCode());
final Object queryHistoryHoursRetention = this.getQueryHistoryHoursRetention();
result = result * prime + (queryHistoryHoursRetention == null ? 43 : queryHistoryHoursRetention.hashCode());
return result;
}

@Override
public String toString()
{
return "DataStoreConfiguration{" +
"jdbcUrl='" + jdbcUrl + '\'' +
", user='" + user + '\'' +
", password='" + password + '\'' +
", driver='" + driver + '\'' +
", queryHistoryHoursRetention=" + queryHistoryHoursRetention +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
*/
package io.trino.gateway.ha.config;

import java.util.Objects;

public class FormAuthConfiguration
{
private SelfSignKeyPairConfiguration selfSignKeyPair;
Expand Down Expand Up @@ -47,50 +45,4 @@ public void setLdapConfigPath(String ldapConfigPath)
{
this.ldapConfigPath = ldapConfigPath;
}

public boolean equals(final Object o)
{
if (o == this) {
return true;
}
if (!(o instanceof FormAuthConfiguration other)) {
return false;
}
if (!other.canEqual(this)) {
return false;
}
final Object selfSignKeyPair = this.getSelfSignKeyPair();
final Object otherSelfSignKeyPair = other.getSelfSignKeyPair();
if (!Objects.equals(selfSignKeyPair, otherSelfSignKeyPair)) {
return false;
}
final Object ldapConfigPath = this.getLdapConfigPath();
final Object otherLdapConfigPath = other.getLdapConfigPath();
return Objects.equals(ldapConfigPath, otherLdapConfigPath);
}

protected boolean canEqual(final Object other)
{
return other instanceof FormAuthConfiguration;
}

public int hashCode()
{
final int prime = 59;
int result = 1;
final Object selfSignKeyPair = this.getSelfSignKeyPair();
result = result * prime + (selfSignKeyPair == null ? 43 : selfSignKeyPair.hashCode());
final Object ldapConfigPath = this.getLdapConfigPath();
result = result * prime + (ldapConfigPath == null ? 43 : ldapConfigPath.hashCode());
return result;
}

@Override
public String toString()
{
return "FormAuthConfiguration{" +
"selfSignKeyPair=" + selfSignKeyPair +
", ldapConfigPath='" + ldapConfigPath + '\'' +
'}';
}
}
Loading

0 comments on commit 8d33156

Please sign in to comment.