content: package net.minecraft.event;
  
  import com.google.common.collect.Maps;
  import lombok.Getter;
  import lombok.Setter;
  
  import java.util.Map;
  
  @Getter
  public class ClickEvent {
      private final ClickEvent.Action action;
  
      @Setter
      private String value;
      @Setter
      private byte[] payload;
  
      public ClickEvent(Action action) {
          this.action = action;
      }
  
      public ClickEvent(ClickEvent.Action theAction, String theValue) {
          this.action = theAction;
          this.value = theValue;
      }
  
      public boolean equals(Object p_equals_1_) {
          if (this == p_equals_1_) {
              return true;
          } else if (p_equals_1_ != null && this.getClass() == p_equals_1_.getClass()) {
              ClickEvent clickevent = (ClickEvent) p_equals_1_;
  
              if (this.action != clickevent.action) {
                  return false;
              } else {
                  if (this.value != null) {
                      return this.value.equals(clickevent.value);
                  } else return clickevent.value == null;
              }
          } else {
              return false;
          }
      }
  
      public String toString() {
          return "ClickEvent{action=" + this.action + ", value='" + this.value + '\'' + '}';
      }
  
      public int hashCode() {
          int i = this.action.hashCode();
          i = 31 * i + (this.value != null ? this.value.hashCode() : 0);
          return i;
      }
  
      public enum Action {
          OPEN_URL("open_url", true),
          OPEN_FILE("open_file", false),
          RUN_COMMAND("run_command", true),
          SUGGEST_COMMAND("suggest_command", true),
          CHANGE_PAGE("change_page", true),
          JOIN_TEAM("join_team", true),
          WARP_TEAMMATES("warp_teammates", true),
          KICK_MEMBERS("kick_members", true),
          LEAVE_TEAM("leave_team", true),
          DISMISS_TEAM("dismiss_team", true);
  
          private static final Map<String, ClickEvent.Action> nameMapping = Maps.newHashMap();
          private final boolean allowedInChat;
          private final String canonicalName;
  
          Action(String canonicalNameIn, boolean allowedInChatIn) {
              this.canonicalName = canonicalNameIn;
              this.allowedInChat = allowedInChatIn;
          }
  
          public boolean shouldAllowInChat() {
              return this.allowedInChat;
          }
  
          public String getCanonicalName() {
              return this.canonicalName;
          }
  
          public static ClickEvent.Action getValueByCanonicalName(String canonicalNameIn) {
              return nameMapping.get(canonicalNameIn);
          }
  
          static {
              for (ClickEvent.Action clickevent$action : values()) {
                  nameMapping.put(clickevent$action.getCanonicalName(), clickevent$action);
              }
          }
      }
  }
  