Package aQute.bnd.differ
Class DiffImpl
- java.lang.Object
-
- aQute.bnd.differ.DiffImpl
-
public class DiffImpl extends java.lang.Object implements Diff, java.lang.Comparable<DiffImpl>, java.util.Formattable
A DiffImpl class compares a newer Element to an older Element. The Element classes hide all the low level details. A Element class is either either Structured (has children) or it is a Leaf, it only has a value. The constructor will first build its children (if any) and then calculate the delta. Each comparable element is translated to an Element. If necessary the Element can be sub classed to provide special behavior.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface aQute.bnd.service.diff.Diff
Diff.Data, Diff.Ignore
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(DiffImpl other)booleanequals(java.lang.Object other)voidformatTo(java.util.Formatter formatter, int flags, int width, int precision)Diffget(java.lang.String name)java.util.Collection<Diff>getChildren()DeltagetDelta()Return the absolute delta.DeltagetDelta(Diff.Ignore ignore)This getDelta calculates the delta but allows the caller to ignore certain Diff objects by calling back the ignore call back parameter.java.lang.StringgetName()TreegetNewer()TreegetOlder()TypegetType()inthashCode()Diff.Dataserialize()java.lang.StringtoString()
-
-
-
Method Detail
-
getDelta
public Delta getDelta()
Return the absolute delta. Also seegetDelta(aQute.bnd.service.diff.Diff.Ignore)that allows you to ignore Diff objects on the fly (and calculate their parents accordingly).
-
getDelta
public Delta getDelta(Diff.Ignore ignore)
This getDelta calculates the delta but allows the caller to ignore certain Diff objects by calling back the ignore call back parameter. This can be useful to ignore warnings/errors.
-
getChildren
public java.util.Collection<Diff> getChildren()
- Specified by:
getChildrenin interfaceDiff
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
compareTo
public int compareTo(DiffImpl other)
- Specified by:
compareToin interfacejava.lang.Comparable<DiffImpl>
-
formatTo
public void formatTo(java.util.Formatter formatter, int flags, int width, int precision)- Specified by:
formatToin interfacejava.util.Formattable
-
-