/*
 * 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.purchase;

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

import java.time.Instant;
import java.util.UUID;

/**
 * Represents a purchase backed by a JDBC SQL data store.
 *
 * @author <a href="https://l1t.li/">Literallie</a>
 * @since 2016-10-10
 */
class SqlPurchase implements Purchase {
    private final UUID uniqueId;
    private final UUID playerId;
    private final Product product;
    private final Instant creationInstant;
    private final String data;
    private final String comment;
    private final int melonsCost;

    SqlPurchase(UUID uniqueId, UUID playerId, Product product, Instant creationInstant,
                String data, String comment, int melonsCost) {
        this.uniqueId = uniqueId;
        this.playerId = playerId;
        this.product = product;
        this.creationInstant = creationInstant;
        this.data = data;
        this.comment = comment;
        this.melonsCost = melonsCost;
    }

    @Override
    public UUID getUniqueId() {
        return uniqueId;
    }

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

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

    @Override
    public Instant getCreationInstant() {
        return creationInstant;
    }

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

    @Override
    public String getComment() {
        return comment;
    }

    @Override
    public int getMelonsCost() {
        return melonsCost;
    }
}

@@ -2032,11 +2032,437 @@
 t;%0A    %7D
+%0A%0A    @Override%0A    public String toString() %7B%0A        return %22SqlPurchase%7B%22 +%0A                %22uniqueId=%22 + uniqueId +%0A                %22, playerId=%22 + playerId +%0A                %22, product=%22 + product +%0A                %22, creationInstant=%22 + creationInstant +%0A                %22, data='%22 + data + '%5C'' +%0A                %22, comment='%22 + comment + '%5C'' +%0A                %22, melonsCost=%22 + melonsCost +%0A                '%7D';%0A    %7D
 %0A%7D%0A

Add toString method to SqlPurchase