Add a fact, replacing any fact with the same name. @param fact to add, must not be null
(Fact<T> fact)
| 62 | * @param fact to add, must not be null |
| 63 | */ |
| 64 | public <T> void add(Fact<T> fact) { |
| 65 | Objects.requireNonNull(fact, "fact must not be null"); |
| 66 | Fact<?> retrievedFact = getFact(fact.getName()); |
| 67 | if (retrievedFact != null) { |
| 68 | remove(retrievedFact); |
| 69 | } |
| 70 | facts.add(fact); |
| 71 | } |
| 72 | |
| 73 | /** |
| 74 | * Remove a fact by name. |