View Javadoc
1   /*
2    * dpkg - Debian Package library and the Debian Package Maven plugin
3    * (c) Copyright 2016 Gerrit Hohl
4    *
5    * This program is free software; you can redistribute it and/or
6    * modify it under the terms of the GNU General Public License
7    * as published by the Free Software Foundation; either version 2
8    * of the License, or (at your option) any later version.
9    *
10   * This program is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13   * GNU General Public License for more details.
14   *
15   * You should have received a copy of the GNU General Public License
16   * along with this program; if not, write to the Free Software
17   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18   */
19  package net.sourceforge.javadpkg.io.impl;
20  
21  import net.sourceforge.javadpkg.io.FileOwner;
22  
23  /**
24   * <p>
25   * A {@link FileOwner} implementation.
26   * </p>
27   *
28   * @author Gerrit Hohl (gerrit-hohl@users.sourceforge.net)
29   * @version <b>1.0</b>, 12.05.2016 by Gerrit Hohl
30   */
31  public class FileOwnerImpl implements FileOwner {
32  	
33  	
34  	/** The group ID. */
35  	private long	groupId;
36  	/** The group name. */
37  	private String	groupName;
38  	/** The user ID. */
39  	private long	userId;
40  	/** The user name. */
41  	private String	userName;
42  
43  
44  	/**
45  	 * <p>
46  	 * Creates a file owner.
47  	 * </p>
48  	 *
49  	 * @param groupId
50  	 *            The group ID.
51  	 * @param groupName
52  	 *            The group name.
53  	 * @param userId
54  	 *            The user ID.
55  	 * @param userName
56  	 *            The user name.
57  	 * @throws IllegalArgumentException
58  	 *             If any of the parameters are <code>null</code>.
59  	 */
60  	public FileOwnerImpl(long groupId, String groupName, long userId, String userName) {
61  		super();
62  
63  		if (groupName == null)
64  			throw new IllegalArgumentException("Argument groupName is null.");
65  		if (userName == null)
66  			throw new IllegalArgumentException("Argument userName is null.");
67  		
68  		this.groupId = groupId;
69  		this.groupName = groupName;
70  		this.userId = userId;
71  		this.userName = userName;
72  	}
73  
74  
75  	@Override
76  	public long getGroupId() {
77  		return this.groupId;
78  	}
79  
80  
81  	@Override
82  	public String getGroupName() {
83  		return this.groupName;
84  	}
85  
86  
87  	@Override
88  	public long getUserId() {
89  		return this.userId;
90  	}
91  
92  
93  	@Override
94  	public String getUserName() {
95  		return this.userName;
96  	}
97  
98  
99  }