@Test public void testSimpleDirective() { Directive dir = new Directive("foo", "bar"); assertEquals("foo=bar", dir.toString()); }
@Override public String toString() { String output = name; if (!value.isEmpty()) { output += "=" + value; } if (!parameters.isEmpty()) { output = output + "; " + parameters.stream().map(Parameter::toString).collect(Collectors.joining("; ")); } return output; }
Directive extends NameValue { @Override public String toString() { String output = name; if (!value.isEmpty()) { output += "=" + value; } if (!parameters.isEmpty()) { output = output + "; " + parameters.stream().map(Parameter::toString).collect(Collectors.joining("; ")); } return output; } }
Directive extends NameValue { @Override public String toString() { String output = name; if (!value.isEmpty()) { output += "=" + value; } if (!parameters.isEmpty()) { output = output + "; " + parameters.stream().map(Parameter::toString).collect(Collectors.joining("; ")); } return output; } Directive(final String name, String value);  Directive(final String name, String value, List<Parameter> parameters); }
Directive extends NameValue { @Override public String toString() { String output = name; if (!value.isEmpty()) { output += "=" + value; } if (!parameters.isEmpty()) { output = output + "; " + parameters.stream().map(Parameter::toString).collect(Collectors.joining("; ")); } return output; } Directive(final String name, String value);  Directive(final String name, String value, List<Parameter> parameters); List<Parameter> getParameters(); int getValueAsInteger(); Parameter getParameter(String name); String getParameterValue(String name); @Override String toString(); }
Directive extends NameValue { @Override public String toString() { String output = name; if (!value.isEmpty()) { output += "=" + value; } if (!parameters.isEmpty()) { output = output + "; " + parameters.stream().map(Parameter::toString).collect(Collectors.joining("; ")); } return output; } Directive(final String name, String value);  Directive(final String name, String value, List<Parameter> parameters); List<Parameter> getParameters(); int getValueAsInteger(); Parameter getParameter(String name); String getParameterValue(String name); @Override String toString();  }