Package com._1c.g5.v8.dt.compare.model
Class ComparisonFlags
- java.lang.Object
-
- com._1c.g5.v8.dt.compare.model.ComparisonFlags
-
public class ComparisonFlags extends Object
An object representing consolidated results of comparison of an hierarchical object.
-
-
Field Summary
Fields Modifier and Type Field Description static ComparisonFlags
NO_FLAGS
A flag tuple with all flags false.
-
Constructor Summary
Constructors Constructor Description ComparisonFlags()
The constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFlags(ComparisonFlags flags)
Adds the specified comparison flags.void
clear()
Clears all flags.static ComparisonFlags
fromBase64(String input)
CreatesComparisonFlags
instance from the specified base64 value constructed earlier bytoBase64()
method.boolean
hasChanged(ComparisonSide side1, ComparisonSide side2)
Checks if the objects compared in the specified direction have changed properties (that is, properties with different values).boolean
hasChangedMainOther()
Returns the flag "Main<->Other has changed"boolean
hasDifferences(ComparisonSide side1, ComparisonSide side2)
Checks whether there are differences between two specified sides, that is, there are changed or partial objects between them.boolean
hasDiffsMainOther()
Checks whether there are differences between the main and other sides, that is, there are changed or partial objects.boolean
hasDoubleChanges()
Tells whether the flags contain conflict changes between MAIN and OTHER relative the COMMON_ANCESTOR.boolean
hasNonDoubleChanges()
Tells whether the flags contain non-conflict changes between MAIN and OTHER.boolean
hasOrderChanged(ComparisonSide side1, ComparisonSide side2)
Checks whether the matched object with these flags has changed its order in its parent collection in the specified direction.boolean
hasUnchanged(ComparisonSide side1, ComparisonSide side2)
Checks if the objects compared in the specified direction have unchanged properties (that is, properties with equal values).boolean
isOnOneSide(ComparisonSide presentSide, ComparisonSide absentSide)
Checks whether there are compared objects present on the specified side and absent at the other specified side.void
merge(ComparisonFlags other)
Merges flags from the specified comparison flags object.void
setHasChanged(ComparisonSide side1, ComparisonSide side2)
Sets the "Has changed properties" flag for the specified direction.void
setHasDoubleChanges()
Sets the "Has double changes" flag valuevoid
setHasOrderChanged(ComparisonSide side1, ComparisonSide side2)
Sets the "Has changed order" flag for the specified direction.void
setHasUnchanged(ComparisonSide side1, ComparisonSide side2)
Sets the "Has unchanged properties" flag for the specified direction.void
setOnOneSide(ComparisonSide presentSide, ComparisonSide absentSide)
Sets the "on one side" flag for the specified direction.String
toBase64()
Returns a base64 representation of the object.String
toString()
Must be synchronized with#fromString(String)
method.
-
-
-
Field Detail
-
NO_FLAGS
public static final ComparisonFlags NO_FLAGS
A flag tuple with all flags false.
-
-
Method Detail
-
fromBase64
public static ComparisonFlags fromBase64(String input)
CreatesComparisonFlags
instance from the specified base64 value constructed earlier bytoBase64()
method.- Parameters:
input
- the input base64 value- Returns:
- the
ComparisonFlags
instance, nevernull
-
setHasChanged
public void setHasChanged(ComparisonSide side1, ComparisonSide side2)
Sets the "Has changed properties" flag for the specified direction.- Parameters:
side1
- the first side of the direction, notnull
side2
- the second side of the direction, notnull
value
- the flag value to set
-
setHasOrderChanged
public void setHasOrderChanged(ComparisonSide side1, ComparisonSide side2)
Sets the "Has changed order" flag for the specified direction.- Parameters:
side1
- the first side of the direction, notnull
side2
- the second side of the direction, notnull
value
- the flag value to set
-
hasChangedMainOther
public boolean hasChangedMainOther()
Returns the flag "Main<->Other has changed"- Returns:
- the flag "Main<->Other has changed"
-
hasDiffsMainOther
public boolean hasDiffsMainOther()
Checks whether there are differences between the main and other sides, that is, there are changed or partial objects.- Returns:
true
if there are differences between the main and other sides.
-
hasChanged
public boolean hasChanged(ComparisonSide side1, ComparisonSide side2)
Checks if the objects compared in the specified direction have changed properties (that is, properties with different values).- Parameters:
side1
- the first side of the direction, notnull
side2
- the second side of the direction, notnull
- Returns:
true
if at least one property in the specified direction has different values
-
hasOrderChanged
public boolean hasOrderChanged(ComparisonSide side1, ComparisonSide side2)
Checks whether the matched object with these flags has changed its order in its parent collection in the specified direction.- Parameters:
side1
- the first side of the direction, notnull
side2
- the second side of the direction, notnull
- Returns:
true
if the object's order was changed
-
setHasUnchanged
public void setHasUnchanged(ComparisonSide side1, ComparisonSide side2)
Sets the "Has unchanged properties" flag for the specified direction.- Parameters:
side1
- the first side of the direction, notnull
side2
- the second side of the direction, notnull
-
hasUnchanged
public boolean hasUnchanged(ComparisonSide side1, ComparisonSide side2)
Checks if the objects compared in the specified direction have unchanged properties (that is, properties with equal values).- Parameters:
side1
- the first side of the direction, notnull
side2
- the second side of the direction, notnull
- Returns:
true
if at least one property in the specified direction has equal values
-
merge
public void merge(ComparisonFlags other)
Merges flags from the specified comparison flags object. This does not include order flags. Call this method to combine flags of child comparison nodes into the parent one.- Parameters:
other
- the comparison object to merge its flags from, notnull
-
addFlags
public void addFlags(ComparisonFlags flags)
Adds the specified comparison flags.- Parameters:
flags
- the flags to be added, notnull
-
clear
public void clear()
Clears all flags.
-
setHasDoubleChanges
public void setHasDoubleChanges()
Sets the "Has double changes" flag value- Parameters:
value
- the value to set
-
hasDoubleChanges
public boolean hasDoubleChanges()
Tells whether the flags contain conflict changes between MAIN and OTHER relative the COMMON_ANCESTOR. This flag is applicable only for three-way comparison case.- Returns:
true
if have conflict changes between MAIN and OTHER,false
otherwise
-
hasNonDoubleChanges
public boolean hasNonDoubleChanges()
Tells whether the flags contain non-conflict changes between MAIN and OTHER. This flag is applicable only for three-way comparison case.- Returns:
true
if have non-conflict changes between MAIN and OTHER,false
otherwise
-
isOnOneSide
public boolean isOnOneSide(ComparisonSide presentSide, ComparisonSide absentSide)
Checks whether there are compared objects present on the specified side and absent at the other specified side.- Parameters:
presentSide
- the "present" side of directionabsentSide
- the "absent" side of direction- Returns:
true
if the flags represent a compared object containing at least one compared subobject present onpresentSide
and absent onabsentSide
-
setOnOneSide
public void setOnOneSide(ComparisonSide presentSide, ComparisonSide absentSide)
Sets the "on one side" flag for the specified direction.- Parameters:
presentSide
- the side on which a partial object is presentabsentSide
- the side on which a partial object is absent
-
hasDifferences
public boolean hasDifferences(ComparisonSide side1, ComparisonSide side2)
Checks whether there are differences between two specified sides, that is, there are changed or partial objects between them.- Parameters:
side1
- the first sideside2
- the second side- Returns:
true
if there are differences between the sides
-
toBase64
public String toBase64()
Returns a base64 representation of the object. Must be synchronized with#fromBase64(long)
method.- Returns:
- the base64 representation of the object.
-
-