1 | /*
|
---|
2 | * Copyright 2002-2005 The Apache Software Foundation
|
---|
3 | *
|
---|
4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
5 | * you may not use this file except in compliance with the License.
|
---|
6 | * You may obtain a copy of the License at
|
---|
7 | *
|
---|
8 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
9 | *
|
---|
10 | * Unless required by applicable law or agreed to in writing, software
|
---|
11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
13 | * See the License for the specific language governing permissions and
|
---|
14 | * limitations under the License.
|
---|
15 | *
|
---|
16 | */
|
---|
17 | package org.apache.tools.ant.taskdefs.cvslib;
|
---|
18 |
|
---|
19 | import org.apache.tools.ant.BuildException;
|
---|
20 |
|
---|
21 | /**
|
---|
22 | * Represents a CVS user with a userID and a full name.
|
---|
23 | *
|
---|
24 | */
|
---|
25 | public class CvsUser {
|
---|
26 | /** The user's Id */
|
---|
27 | private String m_userID;
|
---|
28 | /** The user's full name */
|
---|
29 | private String m_displayName;
|
---|
30 |
|
---|
31 |
|
---|
32 | /**
|
---|
33 | * Set the user's fullname
|
---|
34 | *
|
---|
35 | * @param displayName the user's full name
|
---|
36 | */
|
---|
37 | public void setDisplayname(final String displayName) {
|
---|
38 | m_displayName = displayName;
|
---|
39 | }
|
---|
40 |
|
---|
41 |
|
---|
42 | /**
|
---|
43 | * Set the user's id
|
---|
44 | *
|
---|
45 | * @param userID the user's new id value.
|
---|
46 | */
|
---|
47 | public void setUserid(final String userID) {
|
---|
48 | m_userID = userID;
|
---|
49 | }
|
---|
50 |
|
---|
51 |
|
---|
52 | /**
|
---|
53 | * Get the user's id.
|
---|
54 | *
|
---|
55 | * @return The userID value
|
---|
56 | */
|
---|
57 | String getUserID() {
|
---|
58 | return m_userID;
|
---|
59 | }
|
---|
60 |
|
---|
61 |
|
---|
62 | /**
|
---|
63 | * Get the user's full name
|
---|
64 | *
|
---|
65 | * @return the user's full name
|
---|
66 | */
|
---|
67 | String getDisplayname() {
|
---|
68 | return m_displayName;
|
---|
69 | }
|
---|
70 |
|
---|
71 |
|
---|
72 | /**
|
---|
73 | * validate that this object is configured.
|
---|
74 | *
|
---|
75 | * @exception BuildException if the instance has not be correctly
|
---|
76 | * configured.
|
---|
77 | */
|
---|
78 | void validate() throws BuildException {
|
---|
79 | if (null == m_userID) {
|
---|
80 | final String message = "Username attribute must be set.";
|
---|
81 |
|
---|
82 | throw new BuildException(message);
|
---|
83 | }
|
---|
84 | if (null == m_displayName) {
|
---|
85 | final String message =
|
---|
86 | "Displayname attribute must be set for userID " + m_userID;
|
---|
87 |
|
---|
88 | throw new BuildException(message);
|
---|
89 | }
|
---|
90 | }
|
---|
91 | }
|
---|
92 |
|
---|