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  public class Stream
25  {
26  
27      private String name;
28  
29      private long id;
30  
31      private String basis;
32  
33      private long basisId;
34  
35      private String depot;
36  
37      private Date startDate;
38  
39      private String streamType;
40  
41      public Stream( String name, long id, String basis, long basisId, String depot, Date startDate, String streamType )
42      {
43          this.name = name;
44          this.id = id;
45          this.basis = basis;
46          this.basisId = basisId;
47          this.depot = depot;
48          this.startDate = startDate;
49          this.streamType = streamType;
50      }
51  
52      @Override
53      public int hashCode()
54      {
55          final int prime = 31;
56          int result = 1;
57          result = prime * result + ( ( basis == null ) ? 0 : basis.hashCode() );
58          result = prime * result + (int) ( basisId ^ ( basisId >>> 32 ) );
59          result = prime * result + ( ( depot == null ) ? 0 : depot.hashCode() );
60          result = prime * result + (int) ( id ^ ( id >>> 32 ) );
61          result = prime * result + ( ( name == null ) ? 0 : name.hashCode() );
62          result = prime * result + ( ( startDate == null ) ? 0 : startDate.hashCode() );
63          result = prime * result + ( ( streamType == null ) ? 0 : streamType.hashCode() );
64          return result;
65      }
66  
67      @Override
68      public boolean equals( Object obj )
69      {
70          if ( this == obj )
71              return true;
72          if ( obj == null )
73              return false;
74          if ( getClass() != obj.getClass() )
75              return false;
76          Stream other = (Stream) obj;
77          if ( basis == null )
78          {
79              if ( other.basis != null )
80                  return false;
81          }
82          else if ( !basis.equals( other.basis ) )
83              return false;
84          if ( basisId != other.basisId )
85              return false;
86          if ( depot == null )
87          {
88              if ( other.depot != null )
89                  return false;
90          }
91          else if ( !depot.equals( other.depot ) )
92              return false;
93          if ( id != other.id )
94              return false;
95          if ( name == null )
96          {
97              if ( other.name != null )
98                  return false;
99          }
100         else if ( !name.equals( other.name ) )
101             return false;
102         if ( startDate == null )
103         {
104             if ( other.startDate != null )
105                 return false;
106         }
107         else if ( !startDate.equals( other.startDate ) )
108             return false;
109         if ( streamType == null )
110         {
111             if ( other.streamType != null )
112                 return false;
113         }
114         else if ( !streamType.equals( other.streamType ) )
115             return false;
116         return true;
117     }
118 
119     public String getName()
120     {
121         return name;
122     }
123 
124     public long getId()
125     {
126         return id;
127     }
128 
129     public String getBasis()
130     {
131         return basis;
132     }
133 
134     public long getBasisId()
135     {
136         return basisId;
137     }
138 
139     public String getDepot()
140     {
141         return depot;
142     }
143 
144     public Date getStartDate()
145     {
146         return startDate;
147     }
148 
149     public String getStreamType()
150     {
151         return streamType;
152     }
153 
154     public Boolean isWorkspace()
155     {
156         return "workspace".equals( streamType );
157     }
158 
159 }