Skip to content

Commit

Permalink
removing equals and hashcode
Browse files Browse the repository at this point in the history
  • Loading branch information
salaboy committed Jun 24, 2024
1 parent 732e7f1 commit 587c4af
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 103 deletions.
26 changes: 1 addition & 25 deletions sdk/src/main/java/io/dapr/client/domain/ComponentMetadata.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ public final class ComponentMetadata {
private String type;
private String version;

public ComponentMetadata() {
}

/**
* Constructor for a ComponentMetadata.
*
Expand All @@ -51,26 +48,5 @@ public String getType() {
public String getVersion() {
return version;
}

@Override
public int hashCode() {
return Objects.hash(name, type, version);
}

@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
ComponentMetadata other = (ComponentMetadata) obj;
return Objects.equals(name, other.name) && Objects.equals(type, other.type)
&& Objects.equals(version, other.version);
}


}
25 changes: 0 additions & 25 deletions sdk/src/main/java/io/dapr/client/domain/DaprMetadata.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ public final class DaprMetadata {
private List<ComponentMetadata> components;
private List<SubscriptionMetadata> subscriptions;

public DaprMetadata() {
}

/**
* Constructor for a DaprMetadata.
*
Expand Down Expand Up @@ -61,27 +58,5 @@ public List<ComponentMetadata> getComponents() {
public List<SubscriptionMetadata> getSubscriptions() {
return subscriptions;
}

@Override
public int hashCode() {
return Objects.hash(id, runtimeVersion, components, subscriptions);
}

@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
DaprMetadata other = (DaprMetadata) obj;
return Objects.equals(id, other.id) && Objects.equals(runtimeVersion, other.runtimeVersion)
&& Objects.equals(components, other.components) && Objects.equals(subscriptions, other.subscriptions);
}


}
27 changes: 0 additions & 27 deletions sdk/src/main/java/io/dapr/client/domain/RuleMetadata.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,12 @@

package io.dapr.client.domain;

import java.util.Objects;

/**
* RuleMetadata describes the Subscription Rule's Metadata.
*/
public final class RuleMetadata {
private String path;

public RuleMetadata() {
}

public RuleMetadata(String path) {
this.path = path;
}
Expand All @@ -32,26 +27,4 @@ public String getPath() {
return path;
}

@Override
public int hashCode() {
return Objects.hash(path);
}

@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
RuleMetadata other = (RuleMetadata) obj;
return Objects.equals(path, other.path);
}



}
26 changes: 0 additions & 26 deletions sdk/src/main/java/io/dapr/client/domain/SubscriptionMetadata.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ public final class SubscriptionMetadata {
private String deadLetterTopic;
private List<RuleMetadata> rules;

public SubscriptionMetadata() {
}

/**
* Constructor for a SubscriptionMetadata.
*
Expand Down Expand Up @@ -62,27 +59,4 @@ public List<RuleMetadata> getRules() {
return rules;
}

@Override
public int hashCode() {
return Objects.hash(topic, pubsubname, deadLetterTopic, rules);
}

@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
SubscriptionMetadata other = (SubscriptionMetadata) obj;
return Objects.equals(topic, other.topic) && Objects.equals(pubsubname, other.pubsubname)
&& Objects.equals(deadLetterTopic, other.deadLetterTopic) && Objects.equals(rules, other.rules);
}



}

0 comments on commit 587c4af

Please sign in to comment.