@Test public void setDebounceDelay_throwsIfTooSmall() throws IOException { Button button = new Button(mGpio, LogicState.PRESSED_WHEN_HIGH); mExpectedException.expect(IllegalArgumentException.class); button.setDebounceDelay(-1); }
public void setDebounceDelay(long delay) { if (delay < 0) { throw new IllegalArgumentException("Debounce delay cannot be negative."); } removeDebounceCallback(); mDebounceDelay = delay; }
Button implements AutoCloseable { public void setDebounceDelay(long delay) { if (delay < 0) { throw new IllegalArgumentException("Debounce delay cannot be negative."); } removeDebounceCallback(); mDebounceDelay = delay; } }
Button implements AutoCloseable { public void setDebounceDelay(long delay) { if (delay < 0) { throw new IllegalArgumentException("Debounce delay cannot be negative."); } removeDebounceCallback(); mDebounceDelay = delay; } Button(String pin, LogicState logicLevel); @VisibleForTesting  Button(Gpio buttonGpio, LogicState logicLevel); }
Button implements AutoCloseable { public void setDebounceDelay(long delay) { if (delay < 0) { throw new IllegalArgumentException("Debounce delay cannot be negative."); } removeDebounceCallback(); mDebounceDelay = delay; } Button(String pin, LogicState logicLevel); @VisibleForTesting  Button(Gpio buttonGpio, LogicState logicLevel); String getName(); void setOnButtonEventListener(OnButtonEventListener listener); void setDebounceDelay(long delay); @Override void close(); }
Button implements AutoCloseable { public void setDebounceDelay(long delay) { if (delay < 0) { throw new IllegalArgumentException("Debounce delay cannot be negative."); } removeDebounceCallback(); mDebounceDelay = delay; } Button(String pin, LogicState logicLevel); @VisibleForTesting  Button(Gpio buttonGpio, LogicState logicLevel); String getName(); void setOnButtonEventListener(OnButtonEventListener listener); void setDebounceDelay(long delay); @Override void close();  }