Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright 2012 Daniel Bechler
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  * http://www.apache.org/licenses/LICENSE-2.0
  *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package de.danielbechler.diff;
import static de.danielbechler.diff.Configuration.CircularReferenceMatchingMode.*;

This is the entry point for all comparisons. It determines the type of the given objects and passes them to the appropriate Differ.

Author(s):
Daniel Bechler
public class ObjectDiffer
	{
		{
			final CircularReferenceDetector circularReferenceDetector = new CircularReferenceDetector();
			return circularReferenceDetector;
		}
	};
	{
		{
			final CircularReferenceDetector circularReferenceDetector = new CircularReferenceDetector();
			return circularReferenceDetector;
		}
	};
	private final Configuration configuration;
	private final DifferDelegator delegator;
	ObjectDiffer(final Configuration configuration)
	{
		this. = configuration;
		this. = new DifferDelegator(new DifferFactory(configuration), newCircularReferenceDetectorFactory(configuration));
	}

Recursively inspects the given objects and returns a node representing their differences. Both objects have be have the same type.

Parameters:
working This object will be treated as the successor of the base object.
base This object will be treated as the predecessor of the working object.
<T> The type of the objects to compare.
Returns:
A node representing the differences between the given objects.
	public <T> Node compare(final T workingfinal T base)
	{
		return .delegate(., Instances.of(workingbase));
	}

Deprecated:
The configuration will become an immutable object created by the configuration builder. The only way to configure an ObjectDiffer is by creating a new instance via ObjectDifferFactory. Therefore there will be no need for this getter anymore.
	{
		return ;
	}
	{
		{
		}
		else if (configuration.getCircularReferenceMatchingMode() == )
		{
		}
		throw new IllegalStateException();
	}
New to GrepCode? Check out our FAQ X