This project has retired. For details please refer to its Attic page.
ArtifactContentEntry xref
View Javadoc
1   package org.apache.archiva.rest.api.model;
2   /*
3    * Licensed to the Apache Software Foundation (ASF) under one
4    * or more contributor license agreements.  See the NOTICE file
5    * distributed with this work for additional information
6    * regarding copyright ownership.  The ASF licenses this file
7    * to you under the Apache License, Version 2.0 (the
8    * "License"); you may not use this file except in compliance
9    * with the License.  You may obtain a copy of the License at
10   *
11   *   http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing,
14   * software distributed under the License is distributed on an
15   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16   * KIND, either express or implied.  See the License for the
17   * specific language governing permissions and limitations
18   * under the License.
19   */
20  
21  import javax.xml.bind.annotation.XmlRootElement;
22  import java.io.Serializable;
23  
24  /**
25   * @author Olivier Lamy
26   * @since 1.4-M3
27   */
28  @XmlRootElement( name = "artifactContentEntry" )
29  public class ArtifactContentEntry
30      implements Serializable
31  {
32      private String path;
33  
34      private boolean file;
35  
36      private int depth;
37  
38      private String repositoryId;
39  
40      public ArtifactContentEntry()
41      {
42          // no op
43      }
44  
45  
46      public ArtifactContentEntry( String path, boolean file, int depth, String repositoryId )
47      {
48  
49          this.path = path;
50          this.file = file;
51          this.depth = depth;
52          this.repositoryId = repositoryId;
53      }
54  
55      public String getPath()
56      {
57          return path;
58      }
59  
60      public void setPath( String path )
61      {
62          this.path = path;
63      }
64  
65      public boolean isFile()
66      {
67          return file;
68      }
69  
70      public void setFile( boolean file )
71      {
72          this.file = file;
73      }
74  
75      public int getDepth()
76      {
77          return depth;
78      }
79  
80      public void setDepth( int depth )
81      {
82          this.depth = depth;
83      }
84  
85      public String getRepositoryId()
86      {
87          return repositoryId;
88      }
89  
90      public void setRepositoryId( String repositoryId )
91      {
92          this.repositoryId = repositoryId;
93      }
94  
95  
96      @Override
97      public boolean equals( Object o )
98      {
99          if ( this == o )
100         {
101             return true;
102         }
103         if ( !( o instanceof ArtifactContentEntry ) )
104         {
105             return false;
106         }
107 
108         ArtifactContentEntry that = (ArtifactContentEntry) o;
109 
110         if ( depth != that.depth )
111         {
112             return false;
113         }
114         if ( file != that.file )
115         {
116             return false;
117         }
118         if ( !path.equals( that.path ) )
119         {
120             return false;
121         }
122         if ( !repositoryId.equals( that.repositoryId ) )
123         {
124             return false;
125         }
126 
127         return true;
128     }
129 
130     @Override
131     public int hashCode()
132     {
133         int result = path.hashCode();
134         result = 31 * result + ( file ? 1 : 0 );
135         result = 31 * result + depth;
136         result = 31 * result + repositoryId.hashCode();
137         return result;
138     }
139 
140 
141     @Override
142     public String toString()
143     {
144         final StringBuilder sb = new StringBuilder();
145         sb.append( "ArtifactContentEntry" );
146         sb.append( "{path='" ).append( path ).append( '\'' );
147         sb.append( ", file=" ).append( file );
148         sb.append( ", depth=" ).append( depth );
149         sb.append( ", repositoryId='" ).append( repositoryId ).append( '\'' );
150         sb.append( '}' );
151         return sb.toString();
152     }
153 }