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

import javafx.beans.property.*;
import java.time.LocalDateTime;



/**
 *
 * @author michal
 */
public class HistoryItem {
    private final ObjectProperty<LocalDateTime> dateTime;    
    private final StringProperty date;
    private final ObjectProperty<URL> url;
    private final StringProperty title;
    private final IntegerProperty visitCount;

    /**
     *
     * @return
     */
    public StringProperty getDate() {
        return date;
    }

    /**
     *
     * @return
     */
    public ObjectProperty<URL> getUrl() {
        return url;
    }

    /**
     *
     * @return
     */
    public StringProperty getTitle() {
        return title;
    }

    /**
     *
     * @return
     */
    public IntegerProperty getVisitCount() {
        return visitCount;
    }
    
    public ObjectProperty<LocalDateTime> getDateTime() {
        return dateTime;
    }

    /**
     *
     * @param date
     * @param dt
     * @param url
     * @param title
     * @param visitCount
     */
    public HistoryItem(StringProperty date, ObjectProperty<LocalDateTime> dt, ObjectProperty<URL> url, StringProperty title, IntegerProperty visitCount) {
        this.date = date;
        this.url = url;
        this.title = title;
        this.visitCount = visitCount;
        this.dateTime = dt;
        
              
    }

    public HistoryItem(StringProperty date, ObjectProperty<URL> url, StringProperty title, IntegerProperty visitCount) {
        this.date = date;
        this.url = url;
        this.title = title;
        this.visitCount = visitCount;
        this.dateTime = null;
    }

    @Override
    public String toString() {
        return "HistoryItem{" + this.date.getValue() + ", " + this.url.getValue() + ", "+ this.title.getValue() +"}\n";
    }
    
    
}
