package org.pandaa.test;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Random;

public class MyModel implements Serializable, MyExpiry {
	
	public int asked = 0;
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String name;
	
	private boolean processed;
	
	public void setName(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}
	
	@Override
	public String toString() {
		return name + " asekd: " + asked;
	}
	
	public void setProcessed(boolean processed) {
		this.processed = processed;
	}

	public boolean isProcessed() {
		return processed;
	}
	
	public boolean isExpired() {
		return true;
	}
	
	public int getAsked() {
		return asked;
	}
	
	public Evaluator getEvaluator() {
		return new Evaluator() {
			@Override
			public boolean isExpired(LocalDateTime time) {
				return new Random().nextInt() % 5 == 0;
			}
		};
	}
}
