// Generated by delombok at Sat Oct 04 04:46:56 UTC 2025
package net.md_5.bungee.protocol.packet;

import io.netty.buffer.ByteBuf;
import net.md_5.bungee.protocol.AbstractPacketHandler;
import net.md_5.bungee.protocol.DefinedPacket;
import net.md_5.bungee.protocol.ProtocolConstants;

public class SetCompression extends DefinedPacket {
    private int threshold;

    @Override
    public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) {
        threshold = DefinedPacket.readVarInt(buf);
    }

    @Override
    public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) {
        DefinedPacket.writeVarInt(threshold, buf);
    }

    @Override
    public void handle(AbstractPacketHandler handler) throws Exception {
        handler.handle(this);
    }

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public int getThreshold() {
        return this.threshold;
    }

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public void setThreshold(final int threshold) {
        this.threshold = threshold;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public java.lang.String toString() {
        return "SetCompression(threshold=" + this.getThreshold() + ")";
    }

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public SetCompression() {
    }

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public SetCompression(final int threshold) {
        this.threshold = threshold;
    }

    @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 SetCompression)) return false;
        final SetCompression other = (SetCompression) o;
        if (!other.canEqual((java.lang.Object) this)) return false;
        if (this.getThreshold() != other.getThreshold()) return false;
        return true;
    }

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

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        result = result * PRIME + this.getThreshold();
        return result;
    }
}
