001package org.unix4j.unix.tail; 002 003import org.unix4j.unix.Tail; 004 005/** 006 * Factory for the {@link Tail tail} command returning 007 * a new command instance from every signature method. 008 */ 009public final class TailFactory implements Tail.Interface<TailCommand> { 010 011 /** 012 * The singleton instance of this factory. 013 */ 014 public static final TailFactory INSTANCE = new TailFactory(); 015 016 /** 017 * Private, only used to create singleton instance. 018 */ 019 private TailFactory() { 020 super(); 021 } 022 023 @Override 024 public TailCommand tail() { 025 final TailArguments tailArgs = new TailArguments(); 026 return new TailCommand(tailArgs); 027 } 028 029 @Override 030 public TailCommand tail(String... args) { 031 final TailArguments tailArgs = new TailArguments(args); 032 return new TailCommand(tailArgs); 033 } 034 035 @Override 036 public TailCommand tail(long count) { 037 final TailArguments tailArgs = new TailArguments(); 038 tailArgs.setCount(count); 039 return new TailCommand(tailArgs); 040 } 041 042 @Override 043 public TailCommand tail(TailOptions options, long count) { 044 final TailArguments tailArgs = new TailArguments(options); 045 tailArgs.setCount(count); 046 return new TailCommand(tailArgs); 047 } 048 049 @Override 050 public TailCommand tail(java.io.File... files) { 051 final TailArguments tailArgs = new TailArguments(); 052 tailArgs.setFiles(files); 053 return new TailCommand(tailArgs); 054 } 055 056 @Override 057 public TailCommand tail(org.unix4j.io.Input... inputs) { 058 final TailArguments tailArgs = new TailArguments(); 059 tailArgs.setInputs(inputs); 060 return new TailCommand(tailArgs); 061 } 062 063 @Override 064 public TailCommand tail(long count, java.io.File... files) { 065 final TailArguments tailArgs = new TailArguments(); 066 tailArgs.setCount(count); 067 tailArgs.setFiles(files); 068 return new TailCommand(tailArgs); 069 } 070 071 @Override 072 public TailCommand tail(long count, String... paths) { 073 final TailArguments tailArgs = new TailArguments(); 074 tailArgs.setCount(count); 075 tailArgs.setPaths(paths); 076 return new TailCommand(tailArgs); 077 } 078 079 @Override 080 public TailCommand tail(long count, org.unix4j.io.Input... inputs) { 081 final TailArguments tailArgs = new TailArguments(); 082 tailArgs.setCount(count); 083 tailArgs.setInputs(inputs); 084 return new TailCommand(tailArgs); 085 } 086 087 @Override 088 public TailCommand tail(TailOptions options, long count, java.io.File... files) { 089 final TailArguments tailArgs = new TailArguments(options); 090 tailArgs.setCount(count); 091 tailArgs.setFiles(files); 092 return new TailCommand(tailArgs); 093 } 094 095 @Override 096 public TailCommand tail(TailOptions options, long count, String... paths) { 097 final TailArguments tailArgs = new TailArguments(options); 098 tailArgs.setCount(count); 099 tailArgs.setPaths(paths); 100 return new TailCommand(tailArgs); 101 } 102 103 @Override 104 public TailCommand tail(TailOptions options, long count, org.unix4j.io.Input... inputs) { 105 final TailArguments tailArgs = new TailArguments(options); 106 tailArgs.setCount(count); 107 tailArgs.setInputs(inputs); 108 return new TailCommand(tailArgs); 109 } 110}