events: add tostring/equalsandhashcode to menuoption clicked
This commit is contained in:
@@ -24,8 +24,11 @@
|
||||
*/
|
||||
package net.runelite.api.events;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.ToString;
|
||||
import net.runelite.api.MenuAction;
|
||||
import net.runelite.api.MenuEntry;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
@@ -42,12 +45,15 @@ import net.runelite.api.widgets.Widget;
|
||||
* it seems that this event still triggers with the "Cancel" action.
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
|
||||
@ToString(onlyExplicitlyIncluded = true)
|
||||
public class MenuOptionClicked
|
||||
{
|
||||
/**
|
||||
* The clicked menu entry
|
||||
*/
|
||||
private final MenuEntry menuEntry;
|
||||
|
||||
/**
|
||||
* Whether or not the event has been consumed by a subscriber.
|
||||
*/
|
||||
@@ -57,6 +63,8 @@ public class MenuOptionClicked
|
||||
/**
|
||||
* Action parameter 0. Its value depends on the menuAction.
|
||||
*/
|
||||
@EqualsAndHashCode.Include
|
||||
@ToString.Include
|
||||
public int getParam0()
|
||||
{
|
||||
return menuEntry.getParam0();
|
||||
@@ -65,6 +73,8 @@ public class MenuOptionClicked
|
||||
/**
|
||||
* Action parameter 1. Its value depends on the menuAction.
|
||||
*/
|
||||
@EqualsAndHashCode.Include
|
||||
@ToString.Include
|
||||
public int getParam1()
|
||||
{
|
||||
return menuEntry.getParam1();
|
||||
@@ -73,6 +83,8 @@ public class MenuOptionClicked
|
||||
/**
|
||||
* The option text added to the menu.
|
||||
*/
|
||||
@EqualsAndHashCode.Include
|
||||
@ToString.Include
|
||||
public String getMenuOption()
|
||||
{
|
||||
return menuEntry.getOption();
|
||||
@@ -81,6 +93,8 @@ public class MenuOptionClicked
|
||||
/**
|
||||
* The target of the action.
|
||||
*/
|
||||
@EqualsAndHashCode.Include
|
||||
@ToString.Include
|
||||
public String getMenuTarget()
|
||||
{
|
||||
return menuEntry.getTarget();
|
||||
@@ -89,6 +103,8 @@ public class MenuOptionClicked
|
||||
/**
|
||||
* The action performed.
|
||||
*/
|
||||
@EqualsAndHashCode.Include
|
||||
@ToString.Include
|
||||
public MenuAction getMenuAction()
|
||||
{
|
||||
return menuEntry.getType();
|
||||
@@ -97,6 +113,8 @@ public class MenuOptionClicked
|
||||
/**
|
||||
* The ID of the object, actor, or item that the interaction targets.
|
||||
*/
|
||||
@EqualsAndHashCode.Include
|
||||
@ToString.Include
|
||||
public int getId()
|
||||
{
|
||||
return menuEntry.getIdentifier();
|
||||
@@ -136,6 +154,7 @@ public class MenuOptionClicked
|
||||
* with an associated widget. Such as eg, CC_OP.
|
||||
* @return
|
||||
*/
|
||||
@Nullable
|
||||
public Widget getWidget()
|
||||
{
|
||||
return menuEntry.getWidget();
|
||||
|
||||
Reference in New Issue
Block a user