@Test public void strCmpFunction() throws Exception { FunctionLibrary funcLib = new FunctionLibrary(); DialogLibrary dialogLib = new DialogLibrary(); HashMap<Object, Object> context = new HashMap<>(); Function f = new StrCmpFunction(new ConfigThingy("STRCMP", "\"a\" \"a\" \"a\""), funcLib, dialogLib, context); assertEquals(0, f.parameters().length); assertEquals("true", f.getString(null)); assertTrue(f.getBoolean(null)); Collection<String> dialogFunctions = new ArrayList<>(); f.getFunctionDialogReferences(dialogFunctions); assertTrue(dialogFunctions.isEmpty()); f = new StrCmpFunction(new ConfigThingy("STRCMP", "\"a\" \"a\" \"z\""), funcLib, dialogLib, context); assertEquals("-1", f.getString(null)); f = new StrCmpFunction(new ConfigThingy("STRCMP", "\"z\" \"a\" \"z\""), funcLib, dialogLib, context); assertEquals("1", f.getString(null)); f = new StrCmpFunction(new ConfigThingy("STRCMP", "\"m\" \"a\" \"z\""), funcLib, dialogLib, context); assertEquals("0", f.getString(null)); assertThrows(ConfigurationErrorException.class, () -> new StrCmpFunction(new ConfigThingy("STRCMP", "\"a\""), funcLib, dialogLib, context)); }
public StrCmpFunction(ConfigThingy conf, FunctionLibrary funcLib, DialogLibrary dialogLib, Map<Object, Object> context) { super(conf, funcLib, dialogLib, context); if (subFunction.size() < 2) throw new ConfigurationErrorException(L.m( "Funktion %1 erfordert mindestens 2 Parameter", conf.getName())); }
StrCmpFunction extends MultiFunction { public StrCmpFunction(ConfigThingy conf, FunctionLibrary funcLib, DialogLibrary dialogLib, Map<Object, Object> context) { super(conf, funcLib, dialogLib, context); if (subFunction.size() < 2) throw new ConfigurationErrorException(L.m( "Funktion %1 erfordert mindestens 2 Parameter", conf.getName())); } }
StrCmpFunction extends MultiFunction { public StrCmpFunction(ConfigThingy conf, FunctionLibrary funcLib, DialogLibrary dialogLib, Map<Object, Object> context) { super(conf, funcLib, dialogLib, context); if (subFunction.size() < 2) throw new ConfigurationErrorException(L.m( "Funktion %1 erfordert mindestens 2 Parameter", conf.getName())); } StrCmpFunction(ConfigThingy conf, FunctionLibrary funcLib,
      DialogLibrary dialogLib, Map<Object, Object> context); }
StrCmpFunction extends MultiFunction { public StrCmpFunction(ConfigThingy conf, FunctionLibrary funcLib, DialogLibrary dialogLib, Map<Object, Object> context) { super(conf, funcLib, dialogLib, context); if (subFunction.size() < 2) throw new ConfigurationErrorException(L.m( "Funktion %1 erfordert mindestens 2 Parameter", conf.getName())); } StrCmpFunction(ConfigThingy conf, FunctionLibrary funcLib,
      DialogLibrary dialogLib, Map<Object, Object> context); @Override String getString(Values parameters); }
StrCmpFunction extends MultiFunction { public StrCmpFunction(ConfigThingy conf, FunctionLibrary funcLib, DialogLibrary dialogLib, Map<Object, Object> context) { super(conf, funcLib, dialogLib, context); if (subFunction.size() < 2) throw new ConfigurationErrorException(L.m( "Funktion %1 erfordert mindestens 2 Parameter", conf.getName())); } StrCmpFunction(ConfigThingy conf, FunctionLibrary funcLib,
      DialogLibrary dialogLib, Map<Object, Object> context); @Override String getString(Values parameters);  }