mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-25 07:27:52 +01:00
Add eqauls and hashCode to FunctionName
This commit is contained in:
parent
d8de454a3f
commit
eaeb09ee48
@ -31,11 +31,13 @@ public class FunctionName {
|
|||||||
/**
|
/**
|
||||||
* The name in the WebAssembly.
|
* The name in the WebAssembly.
|
||||||
*/
|
*/
|
||||||
|
@Nonnull
|
||||||
public final String fullName;
|
public final String fullName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Java signature which is used in Java byte code to reference the method call.
|
* The Java signature which is used in Java byte code to reference the method call.
|
||||||
*/
|
*/
|
||||||
|
@Nonnull
|
||||||
public final String signatureName;
|
public final String signatureName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -50,4 +52,30 @@ public class FunctionName {
|
|||||||
fullName = className + '.' + methodName;
|
fullName = className + '.' + methodName;
|
||||||
signatureName = fullName + methodOrField.getType();
|
signatureName = fullName + methodOrField.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return signatureName.hashCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean equals( Object obj ) {
|
||||||
|
if( this == obj ) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if( obj == null ) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if( getClass() != obj.getClass() ) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
FunctionName other = (FunctionName)obj;
|
||||||
|
return signatureName.equals( other.signatureName );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user