/*
 * SPDX-License-Identifier: MIT
 *
 * The MIT License (MIT)
 *
 * Copyright (c) 2015-2022 games647 and contributors
 *
 * 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 com.github.games647.fastlogin.core.shared;

import com.github.games647.fastlogin.core.StoredProfile;
import com.google.common.base.MoreObjects;

import java.util.UUID;

public abstract class LoginSession {

    private final StoredProfile profile;

    private final String requestUsername;
    private String username;
    private UUID uuid;

    protected boolean registered;

    public LoginSession(String requestUsername, boolean registered, StoredProfile profile) {
        this.requestUsername = requestUsername;
        this.username = requestUsername;

        this.registered = registered;
        this.profile = profile;
    }

    public String getRequestUsername() {
        return requestUsername;
    }

    public synchronized String getUsername() {
        return username;
    }

    public synchronized void setVerifiedUsername(String username) {
        this.username = username;
    }

    /**
     * @return This value is always false if we authenticate the player with a cracked authentication
     */
    public synchronized boolean needsRegistration() {
        return !registered;
    }

    public StoredProfile getProfile() {
        return profile;
    }

    /**
     * Get the premium UUID of this player
     *
     * @return the premium UUID or null if not fetched
     */
    public synchronized UUID getUuid() {
        return uuid;
    }

    /**
     * Set the online UUID if it's fetched
     *
     * @param uuid premium UUID
     */
    public synchronized void setUuid(UUID uuid) {
        this.uuid = uuid;
    }

    @Override
    public synchronized String toString() {
        return MoreObjects.toStringHelper(this)
                .add("profile", profile)
                .add("requestUsername", requestUsername)
                .add("username", username)
                .add("uuid", uuid)
                .add("registered", registered)
                .toString();
    }
}

@@ -1304,51 +1304,39 @@
 le;%0A
+%0A
 import 
-com.google.common.base.MoreObjects;%0A
+java.util.StringJoiner;
 %0Aimp
@@ -2764,37 +2764,24 @@
 %0A    public 
-synchronized 
 String toStr
@@ -2807,39 +2807,76 @@
 urn 
-MoreObjects.toStringHelper(this
+new StringJoiner(%22, %22, LoginSession.class.getSimpleName() + %22%5B%22, %22%5D%22
 )%0A  
@@ -2902,18 +2902,20 @@
 %22profile
-%22,
+=%22 +
  profile
@@ -2953,18 +2953,21 @@
 Username
-%22,
+='%22 +
  request
@@ -2970,24 +2970,30 @@
 uestUsername
+ + %22'%22
 )%0A          
@@ -3012,18 +3012,21 @@
 username
-%22,
+='%22 +
  usernam
@@ -3026,16 +3026,22 @@
 username
+ + %22'%22
 )%0A      
@@ -3060,18 +3060,20 @@
 dd(%22uuid
-%22,
+=%22 +
  uuid)%0A 
@@ -3103,18 +3103,20 @@
 gistered
-%22,
+=%22 +
  registe

Replace Guava with Java joiner