From d313ffbdb7024016e2203c24dbc348dbd96db3aa Mon Sep 17 00:00:00 2001 From: zaaarf Date: Wed, 24 Jan 2024 17:35:09 +0100 Subject: chore: version bump + internal reorganisation --- .../ftbsc/lll/mapper/data/MethodSignature.java | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/main/java/ftbsc/lll/mapper/data/MethodSignature.java (limited to 'src/main/java/ftbsc/lll/mapper/data/MethodSignature.java') diff --git a/src/main/java/ftbsc/lll/mapper/data/MethodSignature.java b/src/main/java/ftbsc/lll/mapper/data/MethodSignature.java new file mode 100644 index 0000000..d7515a8 --- /dev/null +++ b/src/main/java/ftbsc/lll/mapper/data/MethodSignature.java @@ -0,0 +1,51 @@ +package ftbsc.lll.mapper.data; + +import java.util.Objects; + +/** + * Container class for method signature data. + */ +public class MethodSignature { + /** + * The name of the method. + */ + public final String name; + + /** + * The descriptor of the method. + */ + public final String descriptor; + + /** + * Constructs a new {@link MethodSignature}. The parameters should be + * either plain or obfuscated in the same way; + * @param name the method name + * @param descriptor the method descriptor + */ + public MethodSignature(String name, String descriptor) { + this.name = name; + this.descriptor = descriptor; + } + + /** + * Checks if two {@link MethodSignature}s represent the same method. + * @param o the other signature + * @return whether they represent the same method + */ + @Override + public boolean equals(Object o) { + if(this == o) return true; + if(o == null || getClass() != o.getClass()) return false; + MethodSignature signature = (MethodSignature) o; + return Objects.equals(name, signature.name) && Objects.equals(descriptor, signature.descriptor); + } + + /** + * Calculates a hash based on name and descriptor. + * @return the hash code + */ + @Override + public int hashCode() { + return Objects.hash(name, descriptor); + } +} -- cgit v1.2.3-56-ga3b1