This project has retired. For details please refer to its
Attic page.
BrowseResultEntry xref
1 package org.apache.archiva.rest.api.model;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 import javax.xml.bind.annotation.XmlRootElement;
22 import java.io.Serializable;
23
24
25
26
27
28 @XmlRootElement( name = "browseResultEntry" )
29 public class BrowseResultEntry
30 implements Comparable<BrowseResultEntry>, Serializable
31 {
32
33 private String name;
34
35 private boolean project;
36
37
38
39
40 private String groupId;
41
42
43
44
45 private String artifactId;
46
47 public BrowseResultEntry()
48 {
49
50 }
51
52 public BrowseResultEntry( String name, boolean project )
53 {
54 this.name = name;
55 this.project = project;
56 }
57
58 public String getName()
59 {
60 return name;
61 }
62
63 public void setName( String name )
64 {
65 this.name = name;
66 }
67
68 public boolean isProject()
69 {
70 return project;
71 }
72
73 public void setProject( boolean project )
74 {
75 this.project = project;
76 }
77
78 @Override
79 public int compareTo( BrowseResultEntry browseGroupResultEntry )
80 {
81 return this.name.compareTo( browseGroupResultEntry.name );
82 }
83
84 public String getGroupId()
85 {
86 return groupId;
87 }
88
89 public void setGroupId( String groupId )
90 {
91 this.groupId = groupId;
92 }
93
94 public BrowseResultEntry groupId( String groupId )
95 {
96 this.groupId = groupId;
97 return this;
98 }
99
100 public String getArtifactId()
101 {
102 return artifactId;
103 }
104
105 public void setArtifactId( String artifactId )
106 {
107 this.artifactId = artifactId;
108 }
109
110 public BrowseResultEntry artifactId( String artifactId )
111 {
112 this.artifactId = artifactId;
113 return this;
114 }
115
116 @Override
117 public String toString()
118 {
119 final StringBuilder sb = new StringBuilder( "BrowseResultEntry{" );
120 sb.append( "name='" ).append( name ).append( '\'' );
121 sb.append( ", project=" ).append( project );
122 sb.append( ", groupId='" ).append( groupId ).append( '\'' );
123 sb.append( ", artifactId='" ).append( artifactId ).append( '\'' );
124 sb.append( '}' );
125 return sb.toString();
126 }
127
128 @Override
129 public boolean equals( Object o )
130 {
131 if ( this == o )
132 {
133 return true;
134 }
135 if ( !( o instanceof BrowseResultEntry ) )
136 {
137 return false;
138 }
139
140 BrowseResultEntry that = (BrowseResultEntry) o;
141
142 if ( project != that.project )
143 {
144 return false;
145 }
146 if ( !name.equals( that.name ) )
147 {
148 return false;
149 }
150
151 return true;
152 }
153
154 @Override
155 public int hashCode()
156 {
157 int result = name.hashCode();
158 result = 31 * result + ( project ? 1 : 0 );
159 return result;
160 }
161 }