diff options
author | Cedric Beust <cedric@beust.com> | 2017-02-28 05:44:54 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-28 05:44:54 -0800 |
commit | a56228788d3ba4cd7674d6c755012253dfc232b1 (patch) | |
tree | a05022ddb9b494c7d56849a25485142ebf7b3521 | |
parent | 9204d90557da604b203b6d5317b8067d8d0312c5 (diff) | |
parent | 0dc395f2cdd82ff6fec1fcd3836e29f1f898c0b3 (diff) | |
download | jcommander-a56228788d3ba4cd7674d6c755012253dfc232b1.tar.gz |
Merge pull request #331 from jakobwenzel/exampleFileListConverter
fixed FileListConverter example
-rw-r--r-- | doc/index.adoc | 8 | ||||
-rw-r--r-- | doc/index.html | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/doc/index.adoc b/doc/index.adoc index b515af1..533828e 100644 --- a/doc/index.adoc +++ b/doc/index.adoc @@ -365,13 +365,13 @@ For example, here is a list converter that turns a string into a `List<File>`: ---- public class FileListConverter implements IStringConverter<List<File>> { @Override - public File convert(String files) { + public List<File> convert(String files) { String [] paths = files.split(","); - List<File> files = new ArrayList<>(); + List<File> fileList = new ArrayList<>(); for(String path : paths){ - files.add(new File(path)); + fileList.add(new File(path)); } - return files; + return fileList; } } ---- diff --git a/doc/index.html b/doc/index.html index 3f5ba89..8f1dfdc 100644 --- a/doc/index.html +++ b/doc/index.html @@ -1194,13 +1194,13 @@ Assert.assertEquals(a.hostPort.port.intValue(), 8080);</code></pre> <div class="content"> <pre class="prettyprint highlight"><code class="language-java" data-lang="java">public class FileListConverter implements IStringConverter<List<File>> { @Override - public File convert(String files) { + public List<File> convert(String files) { String [] paths = files.split(","); - List<File> files = new ArrayList<>(); + List<File> fileList = new ArrayList<>(); for(String path : paths){ - files.add(new File(path)); + fileList.add(new File(path)); } - return files; + return fileList; } }</code></pre> </div> |