-
Notifications
You must be signed in to change notification settings - Fork 271
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
38f0949
commit bebcf82
Showing
3 changed files
with
73 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...erter/src/main/java/io/apicurio/registry/utils/converter/avro/AvroDataSchemaCacheKey.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package io.apicurio.registry.utils.converter.avro; | ||
|
||
import org.apache.kafka.connect.data.Schema; | ||
|
||
import java.util.Map; | ||
import java.util.Objects; | ||
|
||
public class AvroDataSchemaCacheKey { | ||
private final String schemaName; | ||
private final Map<String, String> parameters; | ||
|
||
public AvroDataSchemaCacheKey(Schema schema) { | ||
this.schemaName = schema.name(); | ||
this.parameters = schema.parameters(); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (this == obj) return true; | ||
if (obj == null || getClass() != obj.getClass()) return false; | ||
AvroDataSchemaCacheKey other = (AvroDataSchemaCacheKey) obj; | ||
return Objects.equals(schemaName, other.schemaName) && | ||
Objects.equals(parameters, other.parameters); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(schemaName, parameters); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters