/*
 * This file is part of the Yildiz-Engine project, licenced under the MIT License  (MIT)
 *
 * Copyright (c) 2017 Grégory Van den Borre
 *
 * More infos available: https://www.yildiz-games.be
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
 * documentation files (the "Software"), to deal in the Software without restriction, including without
 * limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
 * of the Software, and to permit persons to whom the Software is furnished to do so,
 * subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or substantial
 * portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
 * OR COPYRIGHT  HOLDERS BE LIABLE FOR ANY CLAIM,
 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE  SOFTWARE.
 */

package be.yildiz.module.network.protocol;

import be.yildiz.common.Token;
import be.yildiz.common.Token.Status;
import be.yildiz.common.id.PlayerId;
import be.yildiz.module.network.exceptions.InvalidNetworkMessage;
import lombok.EqualsAndHashCode;

/**
 * Common code for token messages.
 *
 * @author Grégory Van den Borre
 */
@EqualsAndHashCode(callSuper = false)
abstract class AbstractTokenMessage extends NetworkMessage {

    /**
     * Authentication token.
     */
    private final Token token;

    /**
     * Full constructor.
     *
     * @param token Authentication token.
     */
    protected AbstractTokenMessage(final Token token) {
        super(convert(token));
        this.token = token;
    }

    /**
     * Full constructor.
     *
     * @param message Message from the server to parse.
     * @throws InvalidNetworkMessage If an error occurs while parsing the message.
     */
    protected AbstractTokenMessage(MessageWrapper message) throws InvalidNetworkMessage {
        super(message);
        PlayerId id = this.getPlayerId();
        int key = this.getInt();
        Status status = Status.values()[this.getInt()];
        this.token = Token.any(id, key, status);
    }

    /**
     * Build the list of message parameters from a token.
     *
     * @param token Token to use.
     * @return A list of message parameters.
     */
    private static String[] convert(Token token) {
        return NetworkMessage.convertParams(token.getId(), Integer.valueOf(token.getKey()), token.getStatus().ordinal());
    }

    public Token getToken() {
        return token;
    }
}

@@ -1480,41 +1480,8 @@
 age;
-%0Aimport lombok.EqualsAndHashCode;
 %0A%0A/*
@@ -1561,46 +1561,8 @@
  */%0A
-@EqualsAndHashCode(callSuper = false)%0A
 abst
@@ -2793,11 +2793,408 @@
 n;%0A    %7D
+%0A%0A    @Override%0A    public boolean equals(Object o) %7B%0A        if (this == o) %7B%0A            return true;%0A        %7D%0A        if (o == null %7C%7C getClass() != o.getClass()) %7B%0A            return false;%0A        %7D%0A%0A        AbstractTokenMessage that = (AbstractTokenMessage) o;%0A%0A        return token.equals(that.token);%0A    %7D%0A%0A    @Override%0A    public int hashCode() %7B%0A        return token.hashCode();%0A    %7D
 %0A%7D%0A

Prepare java 9, remove lombok.