@Test public void trimUpdate() { final List<String> setters = new ArrayList<>(); setters.add("$person.setHelloMsg(@{param2});update($person)\n"); assertTrue(SetStatementValidator.validate(setters)); }
private static String trimUpdate(final String setter) { final int lastIndexOfUpdate = setter.lastIndexOf(";update("); if (lastIndexOfUpdate >= 0) { return setter.substring(0, lastIndexOfUpdate); } else { return setter; } }
SetStatementValidator { private static String trimUpdate(final String setter) { final int lastIndexOfUpdate = setter.lastIndexOf(";update("); if (lastIndexOfUpdate >= 0) { return setter.substring(0, lastIndexOfUpdate); } else { return setter; } } }
SetStatementValidator { private static String trimUpdate(final String setter) { final int lastIndexOfUpdate = setter.lastIndexOf(";update("); if (lastIndexOfUpdate >= 0) { return setter.substring(0, lastIndexOfUpdate); } else { return setter; } } private  SetStatementValidator(); }
SetStatementValidator { private static String trimUpdate(final String setter) { final int lastIndexOfUpdate = setter.lastIndexOf(";update("); if (lastIndexOfUpdate >= 0) { return setter.substring(0, lastIndexOfUpdate); } else { return setter; } } private  SetStatementValidator(); static boolean validate(final List<String> setters); }
SetStatementValidator { private static String trimUpdate(final String setter) { final int lastIndexOfUpdate = setter.lastIndexOf(";update("); if (lastIndexOfUpdate >= 0) { return setter.substring(0, lastIndexOfUpdate); } else { return setter; } } private  SetStatementValidator(); static boolean validate(final List<String> setters);  }