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

Method asMap_get

src/main/java/fieldbox/boxes/Box.java:871–884  ·  view source on GitHub ↗
(String p)

Source from the content-addressed store, hash-verified

869 if (calling == null) throw new Error();
870 return calling.apply(this, a);
871 }
872
873 @Override
874 public Object asMap_get(String p) {
875 T q = from.breadthFirst(from.upwards())
876 .map(x -> x.properties.get(storageProperty))
877 .filter(x -> x != null)
878 .filter(x -> x.containsKey(p))
879 .findFirst()
880 .map(x -> x.get(p))
881 .orElseGet(() -> null);
882 if (q != null) return q;
883
884 return from.properties.computeIfAbsent(storageProperty, (k) -> autoconstructor.apply(from))
885 .get(p);
886 }
887

Callers

nothing calls this directly

Calls 7

breadthFirstMethod · 0.80
upwardsMethod · 0.80
computeIfAbsentMethod · 0.80
getMethod · 0.65
applyMethod · 0.65
mapMethod · 0.45
containsKeyMethod · 0.45

Tested by

no test coverage detected