1
0
mirror of https://github.com/pcvolkmer/onkostar-plugin-dnpm.git synced 2025-07-05 18:42:54 +00:00

erste Version

This commit is contained in:
Busfreak
2023-03-10 00:30:42 +01:00
parent 89153c391e
commit 9d66c42460
20 changed files with 1530 additions and 0 deletions

View File

@ -0,0 +1,51 @@
package ATCCodes;
import java.util.Objects;
/**
* Unregistered code as used in Onkostar database
*
* @author Paul-Christian Volkmer
* @since 0.1.0
*/
public class UnregisteredCode implements AgentCode {
private final String code;
private final String name;
public UnregisteredCode(String code, String name) {
this.code = code;
this.name = name;
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
public CodeSystem getSystem() {
return CodeSystem.UNREGISTERED;
}
@Override
public int compareTo(final AgentCode agentCode) {
return this.name.toLowerCase().compareTo(agentCode.getName().toLowerCase());
}
@Override
public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
AgentCode otherAgentCode = (AgentCode) o;
return Objects.equals(code.toLowerCase(), otherAgentCode.getCode().toLowerCase())
&& Objects.equals(name.toLowerCase(), otherAgentCode.getName().toLowerCase());
}
@Override
public int hashCode() {
return Objects.hash(code.toLowerCase(), name.toLowerCase());
}
}