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

Method asMap_set

src/main/java/field/utility/Dict.java:763–788  ·  view source on GitHub ↗
(String name, Object value)

Source from the content-addressed store, hash-verified

761 }
762
763 @Override
764 public Object asMap_set(String name, Object value) {
765
766
767// Dict r = put(new Prop(p), o);
768// return r;
769
770
771 if (value != null && value.getClass().getName().endsWith("ConsString")) value = "" + value;
772
773 Dict.Prop cannon = new Dict.Prop(name).toCanon();
774
775 if (cannon.getAttributes().isTrue(Dict.readOnly, false))
776 throw new IllegalArgumentException("can't write to property " + name);
777
778 Function<Object, Object> c = cannon.getAttributes().get(Dict.customCaster);
779 if (c != null)
780 value = c.apply(value);
781
782 Object converted = Conversions.convert(value, cannon.getTypeInformation());
783 dictionary.put(cannon, converted);
784
785 // put(cannon, converted);
786
787 return this;
788 }
789
790 @Override
791 public Object asMap_new(Object a) {

Callers

nothing calls this directly

Calls 9

convertMethod · 0.95
toCanonMethod · 0.80
isTrueMethod · 0.80
getAttributesMethod · 0.80
getTypeInformationMethod · 0.80
getMethod · 0.65
applyMethod · 0.65
getNameMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected