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