@Test public void createParametersForDefaultQueryPreferences() { checkLsofParameters("lsof -F -T +c0 -o -n -P", _builder.build(Preferences.from("dummyQuery"))); }
public String build(Preferences preferences) { final StringBuilder sb1 = new StringBuilder(COMMAND); final StringBuilder sb2 = new StringBuilder(); for (Filter tv : preferences.getFilters()) { final String type = tv.getType(); final boolean isPathType = type.equals(PATH.getId()); getParameterType(type).appendParameter(isPathType ? sb2 : sb1, tv); } preferences.getOtherPreferences().toParameters(sb1); if (sb2.length() > 0) sb1.append(" --").append(sb2); return sb1.toString(); }
LsofParametersBuilder { public String build(Preferences preferences) { final StringBuilder sb1 = new StringBuilder(COMMAND); final StringBuilder sb2 = new StringBuilder(); for (Filter tv : preferences.getFilters()) { final String type = tv.getType(); final boolean isPathType = type.equals(PATH.getId()); getParameterType(type).appendParameter(isPathType ? sb2 : sb1, tv); } preferences.getOtherPreferences().toParameters(sb1); if (sb2.length() > 0) sb1.append(" --").append(sb2); return sb1.toString(); } }
LsofParametersBuilder { public String build(Preferences preferences) { final StringBuilder sb1 = new StringBuilder(COMMAND); final StringBuilder sb2 = new StringBuilder(); for (Filter tv : preferences.getFilters()) { final String type = tv.getType(); final boolean isPathType = type.equals(PATH.getId()); getParameterType(type).appendParameter(isPathType ? sb2 : sb1, tv); } preferences.getOtherPreferences().toParameters(sb1); if (sb2.length() > 0) sb1.append(" --").append(sb2); return sb1.toString(); }  }
LsofParametersBuilder { public String build(Preferences preferences) { final StringBuilder sb1 = new StringBuilder(COMMAND); final StringBuilder sb2 = new StringBuilder(); for (Filter tv : preferences.getFilters()) { final String type = tv.getType(); final boolean isPathType = type.equals(PATH.getId()); getParameterType(type).appendParameter(isPathType ? sb2 : sb1, tv); } preferences.getOtherPreferences().toParameters(sb1); if (sb2.length() > 0) sb1.append(" --").append(sb2); return sb1.toString(); }  String build(Preferences preferences); }
LsofParametersBuilder { public String build(Preferences preferences) { final StringBuilder sb1 = new StringBuilder(COMMAND); final StringBuilder sb2 = new StringBuilder(); for (Filter tv : preferences.getFilters()) { final String type = tv.getType(); final boolean isPathType = type.equals(PATH.getId()); getParameterType(type).appendParameter(isPathType ? sb2 : sb1, tv); } preferences.getOtherPreferences().toParameters(sb1); if (sb2.length() > 0) sb1.append(" --").append(sb2); return sb1.toString(); }  String build(Preferences preferences);  }