Finished Function module and added breaking change.

This commit is contained in:
2022-12-07 07:31:30 +01:00
parent 342b0cece9
commit 8f7d49b280
39 changed files with 340 additions and 357 deletions
@@ -133,6 +133,12 @@ public enum ClassType
}
}
public String getApply(ClassType other) {
if(other == BOOLEAN) return "test";
if(other == ClassType.OBJECT) return "apply";
return "applyAs"+other.getFileType();
}
public String getEquals(boolean not)
{
switch(this)
@@ -253,7 +253,7 @@ public class PrimitiveCollectionsBuilder extends TemplateProcessor
boolean force = flags.contains("force");
boolean tests = flags.contains("tests");
boolean forceTests = flags.contains("force-tests");
boolean load = !flags.contains("load");
boolean load = flags.contains("load");
boolean save = flags.contains("save");
int flag = (load ? LOAD : 0) | (save ? SAVE : 0);
new PrimitiveCollectionsBuilder(silent).setFlags(flag).process(force);
@@ -34,8 +34,7 @@ public class FunctionModule extends BaseModule
@Override
protected void loadFunctions()
{
addSimpleMapper("VALUE_TEST_VALUE", valueType.isObject() ? "getBoolean" : "get");
addSimpleMapper("TEST_VALUE", keyType.isObject() ? "getBoolean" : "get");
addSimpleMapper("APPLY", keyType.getApply(valueType));
}
@Override
@@ -41,7 +41,6 @@ public class JavaModule extends BaseModule
addSimpleMapper("APPLY_KEY_VALUE", keyType.isObject() ? "apply" : "applyAs"+keyType.getNonFileType());
addSimpleMapper("APPLY_VALUE", valueType.isObject() ? "apply" : "applyAs"+valueType.getNonFileType());
addSimpleMapper("APPLY_CAST", "applyAs"+keyType.getCustomJDKType().getNonFileType());
addSimpleMapper("APPLY", keyType.isObject() ? "apply" : "applyAs"+keyType.getNonFileType());
//Shared by Maps and Pairs so moved to java.
addFunctionMappers("ENTRY_KEY", "get%sKey");