Skip to content

Commit 514bc67

Browse files
committed
Okay, I think I'm actually done with the package refactoring
1 parent 722f355 commit 514bc67

File tree

114 files changed

+1122
-784
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+1122
-784
lines changed

src/integration-test/java/de/danielbechler/diff/ObjectDifferIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012 Daniel Bechler
2+
* Copyright 2014 Daniel Bechler
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,10 +28,10 @@
2828
import de.danielbechler.diff.mock.ObjectWithMethodEqualsOnlyValueProviderMethodOnGetNestedObject;
2929
import de.danielbechler.diff.mock.ObjectWithNestedObject;
3030
import de.danielbechler.diff.node.DiffNode;
31+
import de.danielbechler.diff.node.NodeHierarchyVisitor;
3132
import de.danielbechler.diff.path.NodePath;
3233
import de.danielbechler.diff.selector.CollectionItemElementSelector;
3334
import de.danielbechler.diff.selector.MapKeyElementSelector;
34-
import de.danielbechler.diff.visitors.NodeHierarchyVisitor;
3535
import org.fest.assertions.api.Assertions;
3636
import org.testng.annotations.BeforeMethod;
3737
import org.testng.annotations.Test;

src/integration-test/java/de/danielbechler/diff/example/CanonicalAccessorExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012 Daniel Bechler
2+
* Copyright 2014 Daniel Bechler
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,8 +18,8 @@
1818

1919
import de.danielbechler.diff.ObjectDifferBuilder;
2020
import de.danielbechler.diff.node.DiffNode;
21+
import de.danielbechler.diff.node.NodeHierarchyVisitor;
2122
import de.danielbechler.diff.selector.CollectionItemElementSelector;
22-
import de.danielbechler.diff.visitors.NodeHierarchyVisitor;
2323

2424
import java.util.LinkedList;
2525
import java.util.List;

src/integration-test/java/de/danielbechler/diff/example/EqualsOnlyValueProviderMethodExample.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,25 @@
1+
/*
2+
* Copyright 2014 Daniel Bechler
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package de.danielbechler.diff.example;
218

319
import de.danielbechler.diff.ObjectDifferBuilder;
420
import de.danielbechler.diff.node.DiffNode;
21+
import de.danielbechler.diff.node.PrintingVisitor;
522
import de.danielbechler.diff.path.NodePath;
6-
import de.danielbechler.diff.visitors.PrintingVisitor;
723

824
class EqualsOnlyValueProviderMethodExample
925
{

src/integration-test/java/de/danielbechler/diff/example/Example2IT.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013 Daniel Bechler
2+
* Copyright 2014 Daniel Bechler
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -17,8 +17,8 @@
1717
package de.danielbechler.diff.example
1818

1919
import de.danielbechler.diff.ObjectDifferBuilder
20-
import de.danielbechler.diff.config.introspection.ObjectDiffEqualsOnlyType
21-
import de.danielbechler.diff.config.introspection.ObjectDiffProperty
20+
import de.danielbechler.diff.introspection.ObjectDiffEqualsOnlyType
21+
import de.danielbechler.diff.introspection.ObjectDiffProperty
2222
import de.danielbechler.diff.path.NodePath
2323
import spock.lang.Specification
2424

src/integration-test/java/de/danielbechler/diff/example/IgnoreExample.java

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,26 @@
1+
/*
2+
* Copyright 2014 Daniel Bechler
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package de.danielbechler.diff.example;
218

319
import de.danielbechler.diff.ObjectDifferBuilder;
4-
import de.danielbechler.diff.config.introspection.ObjectDiffProperty;
20+
import de.danielbechler.diff.introspection.ObjectDiffProperty;
521
import de.danielbechler.diff.node.DiffNode;
22+
import de.danielbechler.diff.node.PrintingVisitor;
623
import de.danielbechler.diff.path.NodePath;
7-
import de.danielbechler.diff.visitors.PrintingVisitor;
824

925
/**
1026
* @author Daniel Bechler

src/integration-test/java/de/danielbechler/diff/example/SimpleNodeExample.java

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012 Daniel Bechler
2+
* Copyright 2014 Daniel Bechler
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,10 +16,10 @@
1616

1717
package de.danielbechler.diff.example;
1818

19-
import de.danielbechler.diff.visitors.NodeHierarchyVisitor;
20-
import de.danielbechler.diff.visitors.PrintingVisitor;
2119
import de.danielbechler.diff.ObjectDifferBuilder;
2220
import de.danielbechler.diff.node.DiffNode;
21+
import de.danielbechler.diff.node.NodeHierarchyVisitor;
22+
import de.danielbechler.diff.node.PrintingVisitor;
2323

2424
/**
2525
* @author Daniel Bechler
@@ -30,6 +30,22 @@ private SimpleNodeExample()
3030
{
3131
}
3232

33+
public static void main(final String[] args)
34+
{
35+
final Person bruceWayne = new Person("Bruce", "Wayne");
36+
final Person batman = new Person("Batman", null);
37+
final DiffNode rootNode = ObjectDifferBuilder.buildDefault().compare(batman, bruceWayne);
38+
rootNode.visit(new NodeHierarchyVisitor(10));
39+
rootNode.visit(new PrintingVisitor(batman, bruceWayne)
40+
{
41+
@Override
42+
protected boolean filter(final DiffNode node)
43+
{
44+
return true;
45+
}
46+
});
47+
}
48+
3349
private static class Person
3450
{
3551
private String firstName;
@@ -76,20 +92,4 @@ public String toString()
7692
return sb.toString();
7793
}
7894
}
79-
80-
public static void main(final String[] args)
81-
{
82-
final Person bruceWayne = new Person("Bruce", "Wayne");
83-
final Person batman = new Person("Batman", null);
84-
final DiffNode rootNode = ObjectDifferBuilder.buildDefault().compare(batman, bruceWayne);
85-
rootNode.visit(new NodeHierarchyVisitor(10));
86-
rootNode.visit(new PrintingVisitor(batman, bruceWayne)
87-
{
88-
@Override
89-
protected boolean filter(final DiffNode node)
90-
{
91-
return true;
92-
}
93-
});
94-
}
9595
}

src/integration-test/java/de/danielbechler/diff/example/gettingstarted/GettingStarted.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012 Daniel Bechler
2+
* Copyright 2014 Daniel Bechler
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,13 +16,13 @@
1616

1717
package de.danielbechler.diff.example.gettingstarted;
1818

19-
import de.danielbechler.diff.visitors.PrintingVisitor;
2019
import de.danielbechler.diff.ObjectDiffer;
2120
import de.danielbechler.diff.ObjectDifferBuilder;
2221
import de.danielbechler.diff.example.phonebook.Contact;
2322
import de.danielbechler.diff.example.phonebook.PhoneBook;
2423
import de.danielbechler.diff.example.phonebook.PhoneNumber;
2524
import de.danielbechler.diff.node.DiffNode;
25+
import de.danielbechler.diff.node.PrintingVisitor;
2626

2727
/**
2828
* @author Daniel Bechler

src/integration-test/java/de/danielbechler/diff/example/phonebook/Contact.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012 Daniel Bechler
2+
* Copyright 2014 Daniel Bechler
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
1616

1717
package de.danielbechler.diff.example.phonebook;
1818

19-
import de.danielbechler.diff.config.introspection.ObjectDiffProperty;
19+
import de.danielbechler.diff.introspection.ObjectDiffProperty;
2020
import de.danielbechler.util.Strings;
2121

2222
import java.util.LinkedHashMap;
@@ -27,14 +27,6 @@
2727
*/
2828
public class Contact
2929
{
30-
public static Contact from(final Contact contact)
31-
{
32-
final Contact copy = new Contact(contact.firstName, contact.lastName);
33-
copy.setMiddleName(contact.middleName);
34-
copy.setPhoneNumbers(new LinkedHashMap<String, PhoneNumber>(contact.phoneNumbers));
35-
return copy;
36-
}
37-
3830
private final String firstName;
3931
private final String lastName;
4032
private String middleName;
@@ -46,6 +38,14 @@ public Contact(final String firstName, final String lastName)
4638
this.lastName = lastName;
4739
}
4840

41+
public static Contact from(final Contact contact)
42+
{
43+
final Contact copy = new Contact(contact.firstName, contact.lastName);
44+
copy.setMiddleName(contact.middleName);
45+
copy.setPhoneNumbers(new LinkedHashMap<String, PhoneNumber>(contact.phoneNumbers));
46+
return copy;
47+
}
48+
4949
@ObjectDiffProperty(categories = "name")
5050
public String getFirstName()
5151
{

src/integration-test/java/de/danielbechler/diff/example/phonebook/PhoneNumber.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012 Daniel Bechler
2+
* Copyright 2014 Daniel Bechler
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
1616

1717
package de.danielbechler.diff.example.phonebook;
1818

19-
import de.danielbechler.diff.config.introspection.ObjectDiffEqualsOnlyType;
19+
import de.danielbechler.diff.introspection.ObjectDiffEqualsOnlyType;
2020

2121
/**
2222
* @author Daniel Bechler
Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,26 @@
1-
package de.danielbechler.diff.config.inclusion
1+
/*
2+
* Copyright 2014 Daniel Bechler
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package de.danielbechler.diff.inclusion
218

319
import de.danielbechler.diff.ObjectDifferBuilder
4-
import de.danielbechler.diff.PhoneBookSetup
520
import de.danielbechler.diff.path.NodePath
621
import spock.lang.Specification
722

8-
import static de.danielbechler.diff.PhoneBookSetup.Contact
23+
import static PhoneBookSetup.Contact
924

1025
/**
1126
* Created by Daniel Bechler.

0 commit comments

Comments
 (0)