@Test public void testSetWordwrap() { System.out.println("setWordwrap"); String wordwrap = "80"; Message instance = new Message("Hello", true); instance.setWordwrap(wordwrap); instance.setWordwrap("Moo"); Assert.assertEquals(Integer.parseInt(wordwrap), instance.getWordwrap()); }
protected void setWordwrap(final CommandLine commandLine) { String wordwrap = null; if (commandLine.hasOption(CowsayCli.Opt.WRAP_AT.toString())) { wordwrap = commandLine.getOptionValue(CowsayCli.Opt.WRAP_AT.toString()); } else if (commandLine.hasOption(CowsayCli.Opt.NOWRAP.toString())) { wordwrap = "0"; } if (wordwrap != null) { this.setWordwrap(wordwrap); } }
Message { protected void setWordwrap(final CommandLine commandLine) { String wordwrap = null; if (commandLine.hasOption(CowsayCli.Opt.WRAP_AT.toString())) { wordwrap = commandLine.getOptionValue(CowsayCli.Opt.WRAP_AT.toString()); } else if (commandLine.hasOption(CowsayCli.Opt.NOWRAP.toString())) { wordwrap = "0"; } if (wordwrap != null) { this.setWordwrap(wordwrap); } } }
Message { protected void setWordwrap(final CommandLine commandLine) { String wordwrap = null; if (commandLine.hasOption(CowsayCli.Opt.WRAP_AT.toString())) { wordwrap = commandLine.getOptionValue(CowsayCli.Opt.WRAP_AT.toString()); } else if (commandLine.hasOption(CowsayCli.Opt.NOWRAP.toString())) { wordwrap = "0"; } if (wordwrap != null) { this.setWordwrap(wordwrap); } } Message(final String message, final boolean isThought); }
Message { protected void setWordwrap(final CommandLine commandLine) { String wordwrap = null; if (commandLine.hasOption(CowsayCli.Opt.WRAP_AT.toString())) { wordwrap = commandLine.getOptionValue(CowsayCli.Opt.WRAP_AT.toString()); } else if (commandLine.hasOption(CowsayCli.Opt.NOWRAP.toString())) { wordwrap = "0"; } if (wordwrap != null) { this.setWordwrap(wordwrap); } } Message(final String message, final boolean isThought); String getMessage(); String getThoughts(); void setWordwrap(final String wordwrap); int getWordwrap(); }
Message { protected void setWordwrap(final CommandLine commandLine) { String wordwrap = null; if (commandLine.hasOption(CowsayCli.Opt.WRAP_AT.toString())) { wordwrap = commandLine.getOptionValue(CowsayCli.Opt.WRAP_AT.toString()); } else if (commandLine.hasOption(CowsayCli.Opt.NOWRAP.toString())) { wordwrap = "0"; } if (wordwrap != null) { this.setWordwrap(wordwrap); } } Message(final String message, final boolean isThought); String getMessage(); String getThoughts(); void setWordwrap(final String wordwrap); int getWordwrap(); static final byte DEFAULT_WRAP; }