@Test public void testToString() { SupportedDirections supportedDirections = new SupportedDirections(true, true); Assert.assertEquals("FROM/TO", supportedDirections.toString()); supportedDirections = new SupportedDirections(true, false); Assert.assertEquals("FROM", supportedDirections.toString()); supportedDirections = new SupportedDirections(false, true); Assert.assertEquals("TO", supportedDirections.toString()); supportedDirections = new SupportedDirections(false, false); Assert.assertEquals("", supportedDirections.toString()); }
public String toString() { StringBuffer buffer = new StringBuffer(); if (isDirectionSupported(Direction.FROM)) { buffer.append(Direction.FROM); if (isDirectionSupported(Direction.TO)) { buffer.append(SUPPORTED_DIRECTIONS_SEPARATOR); buffer.append(Direction.TO); } } else if (isDirectionSupported(Direction.TO)) { buffer.append(Direction.TO); } return buffer.toString(); }
SupportedDirections implements Comparable<SupportedDirections> { public String toString() { StringBuffer buffer = new StringBuffer(); if (isDirectionSupported(Direction.FROM)) { buffer.append(Direction.FROM); if (isDirectionSupported(Direction.TO)) { buffer.append(SUPPORTED_DIRECTIONS_SEPARATOR); buffer.append(Direction.TO); } } else if (isDirectionSupported(Direction.TO)) { buffer.append(Direction.TO); } return buffer.toString(); } }
SupportedDirections implements Comparable<SupportedDirections> { public String toString() { StringBuffer buffer = new StringBuffer(); if (isDirectionSupported(Direction.FROM)) { buffer.append(Direction.FROM); if (isDirectionSupported(Direction.TO)) { buffer.append(SUPPORTED_DIRECTIONS_SEPARATOR); buffer.append(Direction.TO); } } else if (isDirectionSupported(Direction.TO)) { buffer.append(Direction.TO); } return buffer.toString(); } SupportedDirections(boolean from, boolean to); }
SupportedDirections implements Comparable<SupportedDirections> { public String toString() { StringBuffer buffer = new StringBuffer(); if (isDirectionSupported(Direction.FROM)) { buffer.append(Direction.FROM); if (isDirectionSupported(Direction.TO)) { buffer.append(SUPPORTED_DIRECTIONS_SEPARATOR); buffer.append(Direction.TO); } } else if (isDirectionSupported(Direction.TO)) { buffer.append(Direction.TO); } return buffer.toString(); } SupportedDirections(boolean from, boolean to); boolean isDirectionSupported(Direction direction); String toString(); static SupportedDirections fromString(String supportedDirections); static SupportedDirections fromDirection(Direction direction); @Override int compareTo(SupportedDirections o); }
SupportedDirections implements Comparable<SupportedDirections> { public String toString() { StringBuffer buffer = new StringBuffer(); if (isDirectionSupported(Direction.FROM)) { buffer.append(Direction.FROM); if (isDirectionSupported(Direction.TO)) { buffer.append(SUPPORTED_DIRECTIONS_SEPARATOR); buffer.append(Direction.TO); } } else if (isDirectionSupported(Direction.TO)) { buffer.append(Direction.TO); } return buffer.toString(); } SupportedDirections(boolean from, boolean to); boolean isDirectionSupported(Direction direction); String toString(); static SupportedDirections fromString(String supportedDirections); static SupportedDirections fromDirection(Direction direction); @Override int compareTo(SupportedDirections o);  }