View Javadoc
1   package org.apache.maven.scm.provider.accurev;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import java.util.Date;
23  
24  /**
25   * 
26   */
27  public class Stream
28  {
29  
30      private String name;
31  
32      private long id;
33  
34      private String basis;
35  
36      private long basisId;
37  
38      private String depot;
39  
40      private Date startDate;
41  
42      private String streamType;
43  
44      public Stream( String name, long id, String basis, long basisId, String depot, Date startDate, String streamType )
45      {
46          this.name = name;
47          this.id = id;
48          this.basis = basis;
49          this.basisId = basisId;
50          this.depot = depot;
51          this.startDate = startDate;
52          this.streamType = streamType;
53      }
54  
55      @Override
56      public int hashCode()
57      {
58          final int prime = 31;
59          int result = 1;
60          result = prime * result + ( ( basis == null ) ? 0 : basis.hashCode() );
61          result = prime * result + (int) ( basisId ^ ( basisId >>> 32 ) );
62          result = prime * result + ( ( depot == null ) ? 0 : depot.hashCode() );
63          result = prime * result + (int) ( id ^ ( id >>> 32 ) );
64          result = prime * result + ( ( name == null ) ? 0 : name.hashCode() );
65          result = prime * result + ( ( startDate == null ) ? 0 : startDate.hashCode() );
66          result = prime * result + ( ( streamType == null ) ? 0 : streamType.hashCode() );
67          return result;
68      }
69  
70      @Override
71      public boolean equals( Object obj )
72      {
73          if ( this == obj )
74          {
75              return true;
76          }
77          if ( obj == null )
78          {
79              return false;
80          }
81          if ( getClass() != obj.getClass() )
82          {
83              return false;
84          }
85          Stream other = (Stream) obj;
86          if ( basis == null )
87          {
88              if ( other.basis != null )
89              {
90                  return false;
91              }
92          }
93          else if ( !basis.equals( other.basis ) )
94          {
95              return false;
96          }
97          if ( basisId != other.basisId )
98          {
99              return false;
100         }
101         if ( depot == null )
102         {
103             if ( other.depot != null )
104             {
105                 return false;
106             }
107         }
108         else if ( !depot.equals( other.depot ) )
109         {
110             return false;
111         }
112         if ( id != other.id )
113         {
114             return false;
115         }
116         if ( name == null )
117         {
118             if ( other.name != null )
119             {
120                 return false;
121             }
122         }
123         else if ( !name.equals( other.name ) )
124         {
125             return false;
126         }
127         if ( startDate == null )
128         {
129             if ( other.startDate != null )
130             {
131                 return false;
132             }
133         }
134         else if ( !startDate.equals( other.startDate ) )
135         {
136             return false;
137         }
138         if ( streamType == null )
139         {
140             if ( other.streamType != null )
141             {
142                 return false;
143             }
144         }
145         else if ( !streamType.equals( other.streamType ) )
146         {
147             return false;
148         }
149         return true;
150     }
151 
152     public String getName()
153     {
154         return name;
155     }
156 
157     public long getId()
158     {
159         return id;
160     }
161 
162     public String getBasis()
163     {
164         return basis;
165     }
166 
167     public long getBasisId()
168     {
169         return basisId;
170     }
171 
172     public String getDepot()
173     {
174         return depot;
175     }
176 
177     public Date getStartDate()
178     {
179         return startDate;
180     }
181 
182     public String getStreamType()
183     {
184         return streamType;
185     }
186 
187     public Boolean isWorkspace()
188     {
189         return "workspace".equals( streamType );
190     }
191 
192 }