deepdiff.core.DiffPoint Maven / Gradle / Ivy
/*
* Copyright 2011 DeepDiff Contributors
*
* 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 deepdiff.core;
/**
* A single point of difference within a {@link DiffUnit}. This class is
* immutable.
*
* This class is currently fairly unstructured. It contains a reference to
* the containing {@link DiffUnit}, and a free-form {@link String} message
* describing the difference. As more implementations of {@link
* DiffPointProcessor} are added, it may become clear what structured data might
* be useful.
*/
public final class DiffPoint {
private DiffUnit diffUnit;
private String message;
/**
* Initializes a new DiffPoint object.
*
* @param diffUnit the diff unit that contains this diff point
* @param message a message describing the difference
*/
public DiffPoint(DiffUnit diffUnit, String message) {
this.diffUnit = diffUnit;
this.message = message;
}
/**
* Returns a message describing the difference
*
* @return a message describing the difference
*/
public String getMessage() {
return message;
}
/**
* Returns the diff unit that contains this diff point
*
* @return the diff unit that contains this diff point
*/
public DiffUnit getDiffUnit() {
return diffUnit;
}
}