Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -282,4 +282,44 @@ public DeleteValue build()

}

@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + location.hashCode();
result = prime * result + options.hashCode();
result = prime * result + vClock.hashCode();
return result;
}

@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof DeleteValue)) {
return false;
}

final DeleteValue other = (DeleteValue) obj;
if (this.location != other.location && (this.location == null || !this.location.equals(other.location))) {
return false;
}
if (this.options != other.options && (this.options == null || !this.options.equals(other.options))) {
return false;
}
if (this.vClock != other.vClock && (this.vClock == null || !this.vClock.equals(other.vClock))) {
return false;
}
return true;
}

@Override
public String toString() {
return String.format("{location: %s, options: %s, vClock: %s}",
location, options, vClock);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -378,4 +378,40 @@ public FetchValue build()
return new FetchValue(this);
}
}

@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + location.hashCode();
result = prime * result + options.hashCode();
return result;
}

@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof FetchValue)) {
return false;
}

final FetchValue other = (FetchValue) obj;
if (this.location != other.location && (this.location == null || !this.location.equals(other.location))) {
return false;
}
if (this.options != other.options && (this.options == null || !this.options.equals(other.options))) {
return false;
}
return true;
}

@Override
public String toString() {
return String.format("{location: %s, options: %s}", location, options);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -323,4 +323,40 @@ T withValues(List<RiakObject> values)
return self();
}
}

@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + location.hashCode();
result = prime * result + values.hashCode();
return result;
}

@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof KvResponseBase)) {
return false;
}

final KvResponseBase other = (KvResponseBase) obj;
if (this.location != other.location && (this.location == null || !this.location.equals(other.location))) {
return false;
}
if (this.values != other.values && (this.values == null || !this.values.equals(other.values))) {
return false;
}
return true;
}

@Override
public String toString() {
return String.format("{location: %s, values: %s}", location, values);
}
}
35 changes: 35 additions & 0 deletions src/main/java/com/basho/riak/client/api/commands/kv/ListKeys.java
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,39 @@ public ListKeys build()
}
}

@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + namespace.hashCode();
result = prime * result + timeout;
return result;
}

@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof ListKeys)) {
return false;
}

final ListKeys other = (ListKeys) obj;
if (this.namespace != other.namespace && (this.namespace == null || !this.namespace.equals(other.namespace))) {
return false;
}
if (this.timeout != other.timeout) {
return false;
}
return true;
}

@Override
public String toString() {
return String.format("{namespace: %s, timeout: %s}", namespace, timeout);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -436,4 +436,45 @@ private void setFailed(Throwable t)
}

}

@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + locations.hashCode();
result = prime * result + options.hashCode();
result = prime * result + maxInFlight;
return result;
}

@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof FetchValue)) {
return false;
}

final MultiFetch other = (MultiFetch) obj;
if (this.locations != other.locations && (this.locations == null || !this.locations.equals(other.locations))) {
return false;
}
if (this.options != other.options && (this.options == null || !this.options.equals(other.options))) {
return false;
}
if (this.maxInFlight != other.maxInFlight) {
return false;
}
return true;
}

@Override
public String toString() {
return String.format("{locations: %s, options: %s, maxInFlight: %s}",
locations, options, maxInFlight);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -474,4 +474,58 @@ public StoreValue build()
return new StoreValue(this);
}
}

@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + namespace.hashCode();
result = prime * result + key.hashCode();
result = prime * result + options.hashCode();
result = prime * result + value.hashCode();
result = prime * result + typeReference.hashCode();
result = prime * result + vclock.hashCode();
return result;
}

@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof StoreValue)) {
return false;
}

final StoreValue other = (StoreValue) obj;
if (this.namespace != other.namespace && (this.namespace == null || !this.namespace.equals(other.namespace))) {
return false;
}
if (this.key != other.key && (this.key == null || !this.key.equals(other.key))) {
return false;
}
if (this.options != other.options && (this.options == null || !this.options.equals(other.options))) {
return false;
}
if (this.value != other.value && (this.value == null || !this.value.equals(other.value))) {
return false;
}
if (this.typeReference != other.typeReference && (this.typeReference == null || !this.typeReference.equals(other.typeReference))) {
return false;
}
if (this.vclock != other.vclock && (this.vclock == null || !this.vclock.equals(other.vclock))) {
return false;
}
return true;
}

@Override
public String toString() {
return String.format("{namespace: %s, key: %s, options: %s, value: %s,"
+ " typeReference: %s, vclock: %s}", namespace, key, options,
value, typeReference, vclock);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -593,4 +593,54 @@ public Location getQueryInfo()
return location;
}
}

@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + location.hashCode();
result = prime * result + update.hashCode();
result = prime * result + typeReference.hashCode();
result = prime * result + fetchOptions.hashCode();
result = prime * result + storeOptions.hashCode();
return result;
}

@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof UpdateValue)) {
return false;
}

final UpdateValue other = (UpdateValue) obj;
if (this.location != other.location && (this.location == null || !this.location.equals(other.location))) {
return false;
}
if (this.update != other.update && (this.update == null || !this.update.equals(other.update))) {
return false;
}
if (this.typeReference != other.typeReference && (this.typeReference == null || !this.typeReference.equals(other.typeReference))) {
return false;
}
if (this.fetchOptions != other.fetchOptions && (this.fetchOptions == null || !this.fetchOptions.equals(other.fetchOptions))) {
return false;
}
if (this.storeOptions != other.storeOptions && (this.storeOptions == null || !this.storeOptions.equals(other.storeOptions))) {
return false;
}
return true;
}

@Override
public String toString() {
return String.format("{location: %s, update: %s, typeReference: %s,"
+ " fetchOptions: %s, storeOptions: %s}", location, update,
typeReference, fetchOptions, storeOptions);
}
}