// Generated by delombok at Tue Dec 16 19:35:27 UTC 2025
package net.md_5.bungee.api.event;

import net.md_5.bungee.api.config.ServerInfo;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.plugin.Event;

/**
 * Called when a player has changed servers.
 */
public class ServerSwitchEvent extends Event {
    /**
     * Player whom the server is for.
     */
    private final ProxiedPlayer player;
    /**
     * Server the player is switch from. May be null if initial proxy
     * connection.
     */
    private final ServerInfo from;

    /**
     * Creates a new {@code ServerSwitchEvent} instance.
     *
     * @param player Player whom the server is for.
     * @param from Server the player is switch from. May be null if initial proxy
     * connection.
     */
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public ServerSwitchEvent(final ProxiedPlayer player, final ServerInfo from) {
        this.player = player;
        this.from = from;
    }

    /**
     * Player whom the server is for.
     */
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public ProxiedPlayer getPlayer() {
        return this.player;
    }

    /**
     * Server the player is switch from. May be null if initial proxy
     * connection.
     */
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public ServerInfo getFrom() {
        return this.from;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public java.lang.String toString() {
        return "ServerSwitchEvent(player=" + this.getPlayer() + ", from=" + this.getFrom() + ")";
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public boolean equals(final java.lang.Object o) {
        if (o == this) return true;
        if (!(o instanceof ServerSwitchEvent)) return false;
        final ServerSwitchEvent other = (ServerSwitchEvent) o;
        if (!other.canEqual((java.lang.Object) this)) return false;
        final java.lang.Object this$player = this.getPlayer();
        final java.lang.Object other$player = other.getPlayer();
        if (this$player == null ? other$player != null : !this$player.equals(other$player)) return false;
        final java.lang.Object this$from = this.getFrom();
        final java.lang.Object other$from = other.getFrom();
        if (this$from == null ? other$from != null : !this$from.equals(other$from)) return false;
        return true;
    }

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    protected boolean canEqual(final java.lang.Object other) {
        return other instanceof ServerSwitchEvent;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        final java.lang.Object $player = this.getPlayer();
        result = result * PRIME + ($player == null ? 43 : $player.hashCode());
        final java.lang.Object $from = this.getFrom();
        result = result * PRIME + ($from == null ? 43 : $from.hashCode());
        return result;
    }
}
