package blockchain;

import java.time.LocalDateTime;

import domain.Incident;

public class IncidentBlock {
	private LocalDateTime timestamp;
	private Incident theIncident;
	private String hash;
	private String previousHash;

	public IncidentBlock(Incident theIncident, String previousHash) {
		this.theIncident = theIncident;
		this.previousHash = previousHash;
		this.timestamp = LocalDateTime.now();
	}

	public LocalDateTime getTimestamp() {
		return timestamp;
	}

	public void setTimestamp(LocalDateTime timestamp) {
		this.timestamp = timestamp;
	}

	public Incident getTheIncident() {
		return theIncident;
	}

	public void setTheIncident(Incident theIncident) {
		this.theIncident = theIncident;
	}

	public String getPreviousHash() {
		return previousHash;
	}

	public void setPreviousHash(String previousHash) {
		this.previousHash = previousHash;
	}

	public String getHash() {
		return hash;
	}

	public void setHash(String hash) {
		this.hash = hash;
	}

	@Override
	public String toString() {
		return "IncidentBlock [timestamp=" + timestamp + ", theIncident=" + theIncident + ", hash=" + hash
				+ ", previousHash=" + previousHash + "]";
	}

}
