MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / putToList

Method putToList

src/main/java/field/utility/Dict.java:613–624  ·  view source on GitHub ↗
(Prop<? extends Collection<T>> key, T value)

Source from the content-addressed store, hash-verified

611
612
613 public <T> Dict putToList(Prop<? extends Collection<T>> key, T value) {
614
615 if (key.toCanon().autoConstructor != null) {
616 Collection<T> c = (Collection<T>) dictionary.computeIfAbsent(key, (k) -> key.toCanon().autoConstructor.get());
617 c.add(value);
618 return this;
619 } else {
620 Collection<T> c = (Collection<T>) dictionary.computeIfAbsent(key, (k) -> new ArrayList<T>());
621 c.add(value);
622 return this;
623 }
624 }
625
626 public <T> Dict putToList(Prop<? extends Collection<T>> key, T value, Supplier<? extends Collection<T>> def) {
627

Callers 14

FLineDrawingMethod · 0.80
FLineInteractionMethod · 0.80
MeshesMethod · 0.80
badgeMethod · 0.80
ViewportMethod · 0.80
asMap_setMethod · 0.80
asMap_setMethod · 0.80
onExecuteMethod · 0.80
onEditMethod · 0.80
extendOptionMethod · 0.80
newShaderFromBoxMethod · 0.80

Calls 4

toCanonMethod · 0.80
computeIfAbsentMethod · 0.80
getMethod · 0.65
addMethod · 0.45

Tested by

no test coverage detected