1 package org.apache.maven.surefire.report;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 public class CategorizedReportEntry
26 extends SimpleReportEntry
27 implements ReportEntry
28 {
29 private final String group;
30
31 public CategorizedReportEntry( String source, String name, String group )
32 {
33 this( source, name, group, null, null );
34 }
35
36 public CategorizedReportEntry( String source, String name, String group, StackTraceWriter stackTraceWriter,
37 Integer elapsed )
38 {
39 super( source, name, stackTraceWriter, elapsed );
40 this.group = group;
41 }
42
43 public CategorizedReportEntry( String source, String name, String group, StackTraceWriter stackTraceWriter,
44 Integer elapsed, String message )
45 {
46 super( source, name, stackTraceWriter, elapsed, message );
47 this.group = group;
48 }
49
50 public static ReportEntry reportEntry( String source, String name, String group, StackTraceWriter stackTraceWriter,
51 Integer elapsed, String message )
52 {
53 return group != null
54 ? new CategorizedReportEntry( source, name, group, stackTraceWriter, elapsed, message )
55 : new SimpleReportEntry( source, name, stackTraceWriter, elapsed, message );
56 }
57
58 public String getGroup()
59 {
60 return group;
61 }
62
63 public boolean equals( Object o )
64 {
65 if ( this == o )
66 {
67 return true;
68 }
69 if ( o == null || getClass() != o.getClass() )
70 {
71 return false;
72 }
73 if ( !super.equals( o ) )
74 {
75 return false;
76 }
77
78 CategorizedReportEntry that = (CategorizedReportEntry) o;
79
80 return !( group != null ? !group.equals( that.group ) : that.group != null );
81
82 }
83
84 public int hashCode()
85 {
86 int result = super.hashCode();
87 result = 31 * result + ( group != null ? group.hashCode() : 0 );
88 return result;
89 }
90 }