Skip to content

Commit

Permalink
Merge pull request #5946 from henning-gerhardt/add_missing_hashcode_m…
Browse files Browse the repository at this point in the history
…ethods

Add missing hashCode methods
  • Loading branch information
solth authored Mar 4, 2024
2 parents 7b1d685 + 571d493 commit 25d1d7f
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Kitodo-API/src/main/java/org/kitodo/api/Metadata.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,15 @@ public boolean equals(Object o) {
return domain == metadata.domain
&& Objects.equals(key, metadata.key);
}

/**
* hashCode method of current class.
*
* @see java.lang.Object#hashCode()
* @return int
*/
@Override
public int hashCode() {
return Objects.hash(domain, key);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -853,4 +853,52 @@ public boolean equals(Object object) {
}
return false;
}

/**
* hashCode method of current class.
*
* @see java.lang.Object#hashCode()
* @return int
*/
@Override
public int hashCode() {
return Objects.hash(
title,
description,
configurationType,
prestructuredImport,
interfaceType,
returnFormat,
metadataFormat,
defaultImportDepth,
parentElementTrimMode,
host,
scheme,
path,
port,
anonymousAccess,
username,
password,
queryDelimiter,
itemFieldXpath,
itemFieldOwnerSubPath,
itemFieldOwnerMetadata,
itemFieldSignatureSubPath,
itemFieldSignatureMetadata,
idPrefix,
searchFields,
urlParameters,
defaultSearchField,
idSearchField,
parentSearchField,
defaultTemplateProcess,
mappingFiles,
parentMappingFile,
sruVersion,
sruRecordSchema,
oaiMetadataPrefix,
metadataRecordIdXPath,
metadataRecordTitleXPath
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
package org.kitodo.data.database.beans;

import java.util.List;
import java.util.Objects;

import javax.persistence.CascadeType;
import javax.persistence.Column;
Expand Down Expand Up @@ -161,4 +162,22 @@ public boolean equals(Object object) {
}
return false;
}

/**
* hashCode method of current class.
*
* @see java.lang.Object#hashCode()
* @return int
*/
@Override
public int hashCode() {
return Objects.hash(
title,
file,
inputMetadataFormat,
outputMetadataFormat,
prestructuredImport,
importConfigurations
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,15 @@ public boolean equals(Object o) {
}
return plainFilter.equals(((ParsedFilter) o).getPlainFilter());
}

/**
* hashCode method of current class.
*
* @see java.lang.Object#hashCode()
* @return int
*/
@Override
public int hashCode() {
return Objects.hash(plainFilter);
}
}

0 comments on commit 25d1d7f

Please sign in to comment.