package tudelft.mentalhealth.motivatepersisting; /** * Describes the current situation of the patient. */ public class Situation { private final PclTrend pcl; private final Trust trust; /** * The current situation of the patient. * * @param pcl the {@link PclTrend} of the patient * @param trust the {@link Trust} of the patient */ public Situation(PclTrend pcl, Trust trust) { if (pcl == null || trust == null) { throw new NullPointerException("pcl and trust must be not null"); } this.pcl = pcl; this.trust = trust; } @Override public String toString() { return "<" + pcl + "," + trust + ">"; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((pcl == null) ? 0 : pcl.hashCode()); result = prime * result + ((trust == null) ? 0 : trust.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Situation other = (Situation) obj; if (pcl != other.pcl) return false; if (trust != other.trust) return false; return true; } }