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 ComparisonFlagsNO_FLAGSA 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 voidaddFlags(ComparisonFlags flags)Adds the specified comparison flags.voidclear()Clears all flags.static ComparisonFlagsfromBase64(String input)CreatesComparisonFlagsinstance from the specified base64 value constructed earlier bytoBase64()method.booleanhasChanged(ComparisonSide side1, ComparisonSide side2)Checks if the objects compared in the specified direction have changed properties (that is, properties with different values).booleanhasChangedMainOther()Returns the flag "Main<->Other has changed"booleanhasDifferences(ComparisonSide side1, ComparisonSide side2)Checks whether there are differences between two specified sides, that is, there are changed or partial objects between them.booleanhasDiffsMainOther()Checks whether there are differences between the main and other sides, that is, there are changed or partial objects.booleanhasDoubleChanges()Tells whether the flags contain conflict changes between MAIN and OTHER relative the COMMON_ANCESTOR.booleanhasNonDoubleChanges()Tells whether the flags contain non-conflict changes between MAIN and OTHER.booleanhasOrderChanged(ComparisonSide side1, ComparisonSide side2)Checks whether the matched object with these flags has changed its order in its parent collection in the specified direction.booleanhasUnchanged(ComparisonSide side1, ComparisonSide side2)Checks if the objects compared in the specified direction have unchanged properties (that is, properties with equal values).booleanisOnOneSide(ComparisonSide presentSide, ComparisonSide absentSide)Checks whether there are compared objects present on the specified side and absent at the other specified side.voidmerge(ComparisonFlags other)Merges flags from the specified comparison flags object.voidsetHasChanged(ComparisonSide side1, ComparisonSide side2)Sets the "Has changed properties" flag for the specified direction.voidsetHasDoubleChanges()Sets the "Has double changes" flag valuevoidsetHasOrderChanged(ComparisonSide side1, ComparisonSide side2)Sets the "Has changed order" flag for the specified direction.voidsetHasUnchanged(ComparisonSide side1, ComparisonSide side2)Sets the "Has unchanged properties" flag for the specified direction.voidsetOnOneSide(ComparisonSide presentSide, ComparisonSide absentSide)Sets the "on one side" flag for the specified direction.StringtoBase64()Returns a base64 representation of the object.StringtoString()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)
CreatesComparisonFlagsinstance from the specified base64 value constructed earlier bytoBase64()method.- Parameters:
input- the input base64 value- Returns:
- the
ComparisonFlagsinstance, 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, notnullside2- the second side of the direction, notnullvalue- 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, notnullside2- the second side of the direction, notnullvalue- 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:
trueif 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, notnullside2- the second side of the direction, notnull- Returns:
trueif 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, notnullside2- the second side of the direction, notnull- Returns:
trueif 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, notnullside2- 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, notnullside2- the second side of the direction, notnull- Returns:
trueif 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:
trueif have conflict changes between MAIN and OTHER,falseotherwise
-
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:
trueif have non-conflict changes between MAIN and OTHER,falseotherwise
-
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:
trueif the flags represent a compared object containing at least one compared subobject present onpresentSideand 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:
trueif 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.
-
-