Package org.stianloader.remapper
Class MemberRef
java.lang.Object
org.stianloader.remapper.MemberRef
A reference to a class member (which can be a field or a method). Note that stianloader-remapper
does not mandate that the member exists and may refer to a member that exists in a superclass or even not at all.
For all intents and purposes this class is just a tuple of an owner, name and descriptor.
This class implements hashCode() and equals(Object) and can thus be used
in hashtable-based structures such as the key of an HashMap.
Instances of this class are immutable.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean@NotNull StringgetDesc()Obtains the descriptor of the member.@NotNull StringgetName()Obtains the name of the member.@NotNull StringgetOwner()Obtains the owner of the member reference, represented via thethe internal nameof the class.inthashCode()@NotNull StringtoString()
-
Constructor Details
-
MemberRef
public MemberRef(@NotNull @NotNull String owner, @NotNull @NotNull String name, @NotNull @NotNull String desc) Constructor. All class names are represented usingthe internal nameof the class - so forward slashes instead of dots.- Parameters:
owner- The owner of the member (not necessarily the class that defines the member)name- The name of the memberdesc- The descriptor of the member
-
-
Method Details
-
equals
-
getDesc
Obtains the descriptor of the member.For methods, the first character of the descriptor will be '(', if the first character is something else, it is a field.
- Returns:
- The descriptor of the member
-
getName
Obtains the name of the member.This class does not define in which namespace the name is, it depends on the context in which the
MemberRefis being used in.- Returns:
- The name of the member.
-
getOwner
Obtains the owner of the member reference, represented via thethe internal nameof the class.- Returns:
- The owner of the member reference
-
hashCode
@Contract(pure=true) public int hashCode() -
toString
-