diff options
author | Jakob Wenzel <wenzel@rs.tu-darmstadt.de> | 2017-02-28 09:45:01 +0100 |
---|---|---|
committer | Jakob Wenzel <wenzel@rs.tu-darmstadt.de> | 2017-02-28 09:45:01 +0100 |
commit | 0dc395f2cdd82ff6fec1fcd3836e29f1f898c0b3 (patch) | |
tree | a05022ddb9b494c7d56849a25485142ebf7b3521 | |
parent | 9204d90557da604b203b6d5317b8067d8d0312c5 (diff) | |
download | jcommander-0dc395f2cdd82ff6fec1fcd3836e29f1f898c0b3.tar.gz |
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> |