Description: add .equals() and .hashCode()

This commit is contained in:
bopol 2021-02-07 22:43:46 +01:00
parent 557934cb17
commit 7a3d9bdb7d
2 changed files with 15 additions and 1 deletions

View File

@ -14,7 +14,7 @@ public abstract class SearchQueryHandlerFactory extends ListLinkHandlerFactory {
///////////////////////////////////
@Override
public abstract String getUrl(String querry, List<String> contentFilter, String sortFilter) throws ParsingException;
public abstract String getUrl(String query, List<String> contentFilter, String sortFilter) throws ParsingException;
public String getSearchString(String url) {
return "";

View File

@ -1,6 +1,7 @@
package org.schabi.newpipe.extractor.stream;
import java.io.Serializable;
import java.util.Objects;
import static org.schabi.newpipe.extractor.utils.Utils.EMPTY_STRING;
@ -30,4 +31,17 @@ public class Description implements Serializable {
public int getType() {
return type;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Description that = (Description) o;
return type == that.type && Objects.equals(content, that.content);
}
@Override
public int hashCode() {
return Objects.hash(content, type);
}
}