DiffResult.java
2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
package org.apache.commons.lang3.builder;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
public class DiffResult
implements Iterable<Diff<?>>
{
public static final String OBJECTS_SAME_STRING = "";
private final List<Diff<?>> a;
private final Object b;
private final Object c;
private final ToStringStyle d;
DiffResult(Object paramObject1, Object paramObject2, List<Diff<?>> paramList, ToStringStyle paramToStringStyle)
{
if (paramObject1 == null) {
throw new IllegalArgumentException("Left hand object cannot be null");
}
if (paramObject2 == null) {
throw new IllegalArgumentException("Right hand object cannot be null");
}
if (paramList == null) {
throw new IllegalArgumentException("List of differences cannot be null");
}
this.a = paramList;
this.b = paramObject1;
this.c = paramObject2;
if (paramToStringStyle == null)
{
this.d = ToStringStyle.DEFAULT_STYLE;
return;
}
this.d = paramToStringStyle;
}
public List<Diff<?>> getDiffs()
{
return Collections.unmodifiableList(this.a);
}
public int getNumberOfDiffs()
{
return this.a.size();
}
public ToStringStyle getToStringStyle()
{
return this.d;
}
public Iterator<Diff<?>> iterator()
{
return this.a.iterator();
}
public String toString()
{
return toString(this.d);
}
public String toString(ToStringStyle paramToStringStyle)
{
if (this.a.size() == 0) {
return "";
}
ToStringBuilder localToStringBuilder = new ToStringBuilder(this.b, paramToStringStyle);
paramToStringStyle = new ToStringBuilder(this.c, paramToStringStyle);
Iterator localIterator = this.a.iterator();
while (localIterator.hasNext())
{
Diff localDiff = (Diff)localIterator.next();
localToStringBuilder.append(localDiff.getFieldName(), localDiff.getLeft());
paramToStringStyle.append(localDiff.getFieldName(), localDiff.getRight());
}
return String.format("%s %s %s", new Object[] { localToStringBuilder.build(), "differs from", paramToStringStyle.build() });
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/org/apache/commons/lang3/builder/DiffResult.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/