MCPcopy
hub / github.com/j-easy/easy-rules / add

Method add

easy-rules-core/src/main/java/org/jeasy/rules/api/Facts.java:64–71  ·  view source on GitHub ↗

Add a fact, replacing any fact with the same name. @param fact to add, must not be null

(Fact<T> fact)

Source from the content-addressed store, hash-verified

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.

Callers 15

testClearMethod · 0.95
putMethod · 0.95
thenMethod · 0.80
unregisterByNameMethod · 0.80
testAddMethod · 0.80
testRemoveMethod · 0.80
testRemoveByNameMethod · 0.80
testGetMethod · 0.80
testGetFactMethod · 0.80

Calls 3

getFactMethod · 0.95
removeMethod · 0.95
getNameMethod · 0.65

Tested by 13

testClearMethod · 0.76
unregisterByNameMethod · 0.64
testAddMethod · 0.64
testRemoveMethod · 0.64
testRemoveByNameMethod · 0.64
testGetMethod · 0.64
testGetFactMethod · 0.64
testAsMapMethod · 0.64
thenMethod · 0.64