Skip to content

Commit

Permalink
Add missing hashCode methods
Browse files Browse the repository at this point in the history
  • Loading branch information
henning-gerhardt committed Feb 28, 2024
1 parent 92e7f32 commit 13430ba
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 13430ba

Please sign in to comment.