/*
 * Copyright (c) 2013 - 2015 xxyy (Philipp Nowak; devnull@nowak-at.net). All rights reserved.
 *
 * Any usage, including, but not limited to, compiling, running, redistributing, printing,
 *  copying and reverse-engineering is strictly prohibited without explicit written permission
 *  from the original author and may result in legal steps being taken.
 *
 * See the included LICENSE file (core/src/main/resources) or email xxyy98+xyclicense@gmail.com for details.
 */

package li.l1t.lanatus.sql.position;

import li.l1t.lanatus.api.position.Position;
import li.l1t.lanatus.api.product.Product;
import li.l1t.lanatus.api.purchase.Purchase;

import java.util.UUID;

/**
 * Represents a position backed by a SQL data store.
 *
 * @author <a href="https://l1t.li/">Literallie</a>
 * @since 2016-10-10
 */
class SqlPosition implements Position {
    private final UUID purchaseId;
    private final UUID playerId;
    private final Product product;
    private final String data;

    SqlPosition(UUID purchaseId, UUID playerId, Product product, String data) {
        this.purchaseId = purchaseId;
        this.playerId = playerId;
        this.product = product;
        this.data = data;
    }

    SqlPosition(Purchase purchase) {
        this(purchase.getUniqueId(), purchase.getPlayerId(), purchase.getProduct(), purchase.getData());
    }

    @Override
    public UUID getPurchaseId() {
        return purchaseId;
    }

    @Override
    public UUID getPlayerId() {
        return playerId;
    }

    @Override
    public Product getProduct() {
        return product;
    }

    @Override
    public String getData() {
        return data;
    }
}

@@ -1651,11 +1651,288 @@
 a;%0A    %7D
+%0A%0A    @Override%0A    public String toString() %7B%0A        return %22SqlPosition%7B%22 +%0A                %22purchaseId=%22 + purchaseId +%0A                %22, playerId=%22 + playerId +%0A                %22, product=%22 + product +%0A                %22, data='%22 + data + '%5C'' +%0A                '%7D';%0A    %7D
 %0A%7D%0A

Add toString() method to SqlPosition