/* * Copyright (c) 2018 univento.eu - All rights reserved * You are not allowed to use, distribute or modify this code */ package eu.univento.commons.player.user; import eu.univento.commons.Commons; import io.vertx.ext.web.client.WebClient; import lombok.AllArgsConstructor; import lombok.Getter; import java.util.List; import java.util.concurrent.CompletableFuture; /** * @author joethei * @version 1.0 */ @Getter @AllArgsConstructor public class UserInformation{ private static WebClient client; public static CompletableFuture get(String identifier) { CompletableFuture future = new CompletableFuture<>(); if(client == null) client = WebClient.create(Commons.getCommons().getVertx()); client.getAbs("https://api.univento.eu/private/player/" + identifier).ssl(true).send(ar -> { if(ar.succeeded()) { future.complete(ar.result().bodyAsJsonObject().mapTo(UserInformation.class)); }else future.complete(null); }); return future; } private Result result; private String uuid; private String username; private boolean premium; private List history; private UserProperties properties; private Updated updated; }