001package org.unix4j.unix.cat; 002 003import org.unix4j.unix.Cat; 004 005/** 006 * Factory for the {@link Cat cat} command returning 007 * a new command instance from every signature method. 008 */ 009public final class CatFactory implements Cat.Interface<CatCommand> { 010 011 /** 012 * The singleton instance of this factory. 013 */ 014 public static final CatFactory INSTANCE = new CatFactory(); 015 016 /** 017 * Private, only used to create singleton instance. 018 */ 019 private CatFactory() { 020 super(); 021 } 022 023 @Override 024 public CatCommand cat() { 025 final CatArguments catArgs = new CatArguments(); 026 return new CatCommand(catArgs); 027 } 028 029 @Override 030 public CatCommand cat(String... args) { 031 final CatArguments catArgs = new CatArguments(args); 032 return new CatCommand(catArgs); 033 } 034 035 @Override 036 public CatCommand cat(java.io.File... files) { 037 final CatArguments catArgs = new CatArguments(); 038 catArgs.setFiles(files); 039 return new CatCommand(catArgs); 040 } 041 042 @Override 043 public CatCommand cat(org.unix4j.io.Input... inputs) { 044 final CatArguments catArgs = new CatArguments(); 045 catArgs.setInputs(inputs); 046 return new CatCommand(catArgs); 047 } 048 049 @Override 050 public CatCommand cat(CatOptions options) { 051 final CatArguments catArgs = new CatArguments(options); 052 return new CatCommand(catArgs); 053 } 054 055 @Override 056 public CatCommand cat(CatOptions options, java.io.File... files) { 057 final CatArguments catArgs = new CatArguments(options); 058 catArgs.setFiles(files); 059 return new CatCommand(catArgs); 060 } 061 062 @Override 063 public CatCommand cat(CatOptions options, String... paths) { 064 final CatArguments catArgs = new CatArguments(options); 065 catArgs.setPaths(paths); 066 return new CatCommand(catArgs); 067 } 068 069 @Override 070 public CatCommand cat(CatOptions options, org.unix4j.io.Input... inputs) { 071 final CatArguments catArgs = new CatArguments(options); 072 catArgs.setInputs(inputs); 073 return new CatCommand(catArgs); 074 } 075}