/** * Helper method for obtaining specific fact conclusions. * * @param factType The type of facts to return. * @return The fact conclusions that match the factType. An empty list will be returned if no facts are found. */ @JsonIgnore @org.codehaus.jackson.annotate.JsonIgnore public List<Fact> getFacts(FactType factType) { ArrayList<Fact> factsToReturn = new ArrayList<Fact>(); if (facts != null && factType != null) { for (Fact fact : facts) { if (fact.getKnownType() != null && fact.getKnownType().equals(factType)) { factsToReturn.add(fact); } } } return factsToReturn; }
/** * Get the first fact of the specified type. * * @param type The type. * @return the first fact in the fact list of the specified type, or null if none. */ @JsonIgnore @org.codehaus.jackson.annotate.JsonIgnore public Fact getFirstFactOfType(FactType type) { if (this.facts == null) { return null; } for (Fact fact : this.facts) { if (type.equals(fact.getKnownType())) { return fact; } } return null; }
@Override public String toString() { return "type=" + getKnownType() + ",value=" + getValue() + ",date=" + getDate() + ",place=" + getPlace(); }