package com.codegence.aurora.server;

import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBAttribute;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBAutoGeneratedKey;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBHashKey;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBTable;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.validator.constraints.NotEmpty;


/**
 * Created by lmorganti on 19/02/16.
 */
@DynamoDBTable(tableName = "cgServers")
@AllArgsConstructor
@NoArgsConstructor
public class Server {
    private String serverID;
    private String playerID;
    @Setter
    @NotEmpty
    private String nickName;
    @Setter
    @NotEmpty
    private String url;

    @DynamoDBHashKey
    @DynamoDBAutoGeneratedKey
    public String getServerID() {
        return serverID;
    }

    @DynamoDBAttribute
    public String getNickName() {
        return nickName;
    }

    @DynamoDBAttribute
    @JsonIgnore
    public String getPlayerID() {
        return playerID;
    }

    @DynamoDBAttribute
    public String getUrl() {
        return url;
    }

    @JsonIgnore
    public void setServerID(String serverID) {
        this.serverID = serverID;
    }

    @JsonIgnore
    public void setPlayerID(String playerID) {
        this.playerID = playerID;
    }
}
