org.assertj.android.api.content.ContentValuesEntry Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of assertj-android Show documentation
Show all versions of assertj-android Show documentation
A set of AssertJ assertion helpers geared toward testing Android.
package org.assertj.android.api.content;
import static org.assertj.core.util.Objects.areEqual;
import static org.assertj.core.util.Objects.hashCodeFor;
import static org.assertj.core.util.Objects.HASH_CODE_PRIME;
import static org.assertj.core.util.Strings.quote;
public class ContentValuesEntry {
private final String key;
private final Object value;
public static ContentValuesEntry entry(String key, Object value) {
return new ContentValuesEntry(key, value);
}
private ContentValuesEntry(String key, Object value) {
this.key = key;
this.value = value;
}
public String getKey() {
return key;
}
public Object getValue() {
return value;
}
@Override public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
ContentValuesEntry other = (ContentValuesEntry) obj;
return areEqual(key, other.key) && areEqual(value, other.value);
}
@Override public int hashCode() {
int result = 1;
result = HASH_CODE_PRIME * result + hashCodeFor(key);
result = HASH_CODE_PRIME * result + hashCodeFor(value);
return result;
}
@Override public String toString() {
return String.format("%s[key=%s, value=%s]", getClass().getSimpleName(), quote(key), quote(value));
}
}