@Test public void testSetShownLength() { FormatterConfig config = new FormatterConfig(); try { config.setShownLength(-1); fail("Should throw on negative length."); } catch (IllegalArgumentException e) {} config.setShownLength(0); assertEquals(0, config.getShownLength()); assertTrue(config.willLimitShowLength()); config.setShownLength(1); assertEquals(1, config.getShownLength()); assertTrue(config.willLimitShowLength()); }
public FormatterConfig setShownLength(int shownLength) { checkArgument(shownLength >= 0, "Shown length cannot be negative"); this.shownLength = shownLength; return this; }
FormatterConfig { public FormatterConfig setShownLength(int shownLength) { checkArgument(shownLength >= 0, "Shown length cannot be negative"); this.shownLength = shownLength; return this; } }
FormatterConfig { public FormatterConfig setShownLength(int shownLength) { checkArgument(shownLength >= 0, "Shown length cannot be negative"); this.shownLength = shownLength; return this; } FormatterConfig();  FormatterConfig(FormatterConfig other); }
FormatterConfig { public FormatterConfig setShownLength(int shownLength) { checkArgument(shownLength >= 0, "Shown length cannot be negative"); this.shownLength = shownLength; return this; } FormatterConfig();  FormatterConfig(FormatterConfig other); boolean willPrintTimestamps(); FormatterConfig setPrintTimestamps(boolean printTimestamps); int getShownLength(); boolean willLimitShowLength(); FormatterConfig setShownLength(int shownLength); FormatterConfig doNotLimitShowLength(); Supplier<DateFormat> getDateFormatSupplier(); FormatterConfig setDateFormatSupplier(Supplier<DateFormat> dateFormatSupplier); }
FormatterConfig { public FormatterConfig setShownLength(int shownLength) { checkArgument(shownLength >= 0, "Shown length cannot be negative"); this.shownLength = shownLength; return this; } FormatterConfig();  FormatterConfig(FormatterConfig other); boolean willPrintTimestamps(); FormatterConfig setPrintTimestamps(boolean printTimestamps); int getShownLength(); boolean willLimitShowLength(); FormatterConfig setShownLength(int shownLength); FormatterConfig doNotLimitShowLength(); Supplier<DateFormat> getDateFormatSupplier(); FormatterConfig setDateFormatSupplier(Supplier<DateFormat> dateFormatSupplier);  }