/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package yafft.FFModel.ModelItems;

import java.sql.Timestamp;
import java.util.ArrayList;
import javafx.beans.property.*;

/**
 *
 * @author michal
 */
public class Cookie {
    private final StringProperty domain;

    private final ArrayList<CookieValue> data;

    public Cookie(String domain) {
        this.domain = new SimpleStringProperty(domain);
        this.data = new ArrayList<>();
    }
    
    public void addValue(String path, String key, String value, Timestamp expiry, Timestamp creationTime) {
        this.data.add(new CookieValue(null, path, key, value, expiry, creationTime));
        
    }
    
    public void addValue(CookieValue cv) {
        this.data.add(cv);
    }
    
    public ArrayList<CookieValue> getValues() {
        return this.data;
    }

    public StringProperty getDomain() {
        return domain;
    }
    
    
    @Override
    public String toString() {
        return "Cookie{" + "domain=" + domain + ", data=" + data + '}';
    }
    
    
    
    
    
}
