001package org.unix4j.unix.uniq;
002
003import org.unix4j.unix.Uniq;
004
005/**
006 * Factory for the {@link Uniq uniq} command returning 
007 * a new command instance from every signature method.
008 */
009public final class UniqFactory implements Uniq.Interface<UniqCommand> {
010        
011        /**
012         * The singleton instance of this factory.
013         */
014        public static final UniqFactory INSTANCE = new UniqFactory();
015
016        /**
017         * Private, only used to create singleton instance.
018         */
019        private UniqFactory() {
020                super();
021        }
022
023        @Override
024        public UniqCommand uniq() {
025                final UniqArguments uniqArgs = new UniqArguments();
026                return new UniqCommand(uniqArgs);
027        }
028
029        @Override
030        public UniqCommand uniq(String... args) {
031                final UniqArguments uniqArgs = new UniqArguments(args);
032                return new UniqCommand(uniqArgs);
033        }
034
035        @Override
036        public UniqCommand uniq(java.io.File file) {
037                final UniqArguments uniqArgs = new UniqArguments();
038                uniqArgs.setFile(file);
039                return new UniqCommand(uniqArgs);
040        }
041
042        @Override
043        public UniqCommand uniq(String path) {
044                final UniqArguments uniqArgs = new UniqArguments();
045                uniqArgs.setPath(path);
046                return new UniqCommand(uniqArgs);
047        }
048
049        @Override
050        public UniqCommand uniq(UniqOptions options) {
051                final UniqArguments uniqArgs = new UniqArguments(options);
052                return new UniqCommand(uniqArgs);
053        }
054
055        @Override
056        public UniqCommand uniq(UniqOptions options, java.io.File file) {
057                final UniqArguments uniqArgs = new UniqArguments(options);
058                uniqArgs.setFile(file);
059                return new UniqCommand(uniqArgs);
060        }
061
062        @Override
063        public UniqCommand uniq(UniqOptions options, String path) {
064                final UniqArguments uniqArgs = new UniqArguments(options);
065                uniqArgs.setPath(path);
066                return new UniqCommand(uniqArgs);
067        }
068}