001package org.unix4j.unix.wc; 002 003import org.unix4j.unix.Wc; 004 005/** 006 * Factory for the {@link Wc wc} command returning 007 * a new command instance from every signature method. 008 */ 009public final class WcFactory implements Wc.Interface<WcCommand> { 010 011 /** 012 * The singleton instance of this factory. 013 */ 014 public static final WcFactory INSTANCE = new WcFactory(); 015 016 /** 017 * Private, only used to create singleton instance. 018 */ 019 private WcFactory() { 020 super(); 021 } 022 023 @Override 024 public WcCommand wc() { 025 final WcArguments wcArgs = new WcArguments(); 026 return new WcCommand(wcArgs); 027 } 028 029 @Override 030 public WcCommand wc(String... args) { 031 final WcArguments wcArgs = new WcArguments(args); 032 return new WcCommand(wcArgs); 033 } 034 035 @Override 036 public WcCommand wc(java.io.File... files) { 037 final WcArguments wcArgs = new WcArguments(); 038 wcArgs.setFiles(files); 039 return new WcCommand(wcArgs); 040 } 041 042 @Override 043 public WcCommand wc(WcOptions options) { 044 final WcArguments wcArgs = new WcArguments(options); 045 return new WcCommand(wcArgs); 046 } 047 048 @Override 049 public WcCommand wc(WcOptions options, java.io.File... files) { 050 final WcArguments wcArgs = new WcArguments(options); 051 wcArgs.setFiles(files); 052 return new WcCommand(wcArgs); 053 } 054 055 @Override 056 public WcCommand wc(WcOptions options, String[] paths) { 057 final WcArguments wcArgs = new WcArguments(options); 058 wcArgs.setPaths(paths); 059 return new WcCommand(wcArgs); 060 } 061}