@Test public void getBoolean() { BooleanPM model = new BooleanPM(); model.setText(model.getOptions().get(true)); assertEquals("pM.getBoolean()", true, model.getBoolean()); model.setText(model.getOptions().get(false)); assertEquals("pM.getBoolean()", false, model.getBoolean()); model.setText(""); assertEquals("pM.getBoolean()", null, model.getBoolean()); }
public Boolean getBoolean() throws ConversionException { if (this.isEmpty()) { return null; } String strVal = this.getText(); Options<Boolean> options = this.getOptions(); try { return options.getKey(strVal); } catch (NoSuchElementException ex) { throw new ConversionException("strVal='" + strVal + "' is not a boolean", ex); } }
BooleanPM extends TextPM implements IBooleanPM { public Boolean getBoolean() throws ConversionException { if (this.isEmpty()) { return null; } String strVal = this.getText(); Options<Boolean> options = this.getOptions(); try { return options.getKey(strVal); } catch (NoSuchElementException ex) { throw new ConversionException("strVal='" + strVal + "' is not a boolean", ex); } } }
BooleanPM extends TextPM implements IBooleanPM { public Boolean getBoolean() throws ConversionException { if (this.isEmpty()) { return null; } String strVal = this.getText(); Options<Boolean> options = this.getOptions(); try { return options.getKey(strVal); } catch (NoSuchElementException ex) { throw new ConversionException("strVal='" + strVal + "' is not a boolean", ex); } } BooleanPM(); }
BooleanPM extends TextPM implements IBooleanPM { public Boolean getBoolean() throws ConversionException { if (this.isEmpty()) { return null; } String strVal = this.getText(); Options<Boolean> options = this.getOptions(); try { return options.getKey(strVal); } catch (NoSuchElementException ex) { throw new ConversionException("strVal='" + strVal + "' is not a boolean", ex); } } BooleanPM(); void setBoolean(Boolean b); Boolean getBoolean(); void setDefaultBoolean(Boolean value); }
BooleanPM extends TextPM implements IBooleanPM { public Boolean getBoolean() throws ConversionException { if (this.isEmpty()) { return null; } String strVal = this.getText(); Options<Boolean> options = this.getOptions(); try { return options.getKey(strVal); } catch (NoSuchElementException ex) { throw new ConversionException("strVal='" + strVal + "' is not a boolean", ex); } } BooleanPM(); void setBoolean(Boolean b); Boolean getBoolean(); void setDefaultBoolean(Boolean value);  }