Package com._1c.g5.v8.dt.compare.model
Class ComparisonFlags
java.lang.Object
com._1c.g5.v8.dt.compare.model.ComparisonFlags
An object representing consolidated results of comparison of an hierarchical object.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFlags(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).booleanReturns 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.booleanChecks whether there are differences between the main and other sides, that is, there are changed or partial objects.booleanTells whether the flags contain conflict changes between MAIN and OTHER relative the COMMON_ANCESTOR.booleanTells 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.voidSets 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.toBase64()Returns a base64 representation of the object.toString()Must be synchronized with#fromString(String)method.
-
Field Details
-
NO_FLAGS
A flag tuple with all flags false.
-
-
Constructor Details
-
ComparisonFlags
public ComparisonFlags()The constructor.
-
-
Method Details
-
fromBase64
CreatesComparisonFlagsinstance from the specified base64 value constructed earlier bytoBase64()method.- Parameters:
input- the input base64 value- Returns:
- the
ComparisonFlagsinstance, nevernull
-
setHasChanged
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
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
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
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
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
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
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
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
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
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
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
Returns a base64 representation of the object. Must be synchronized with#fromBase64(long)method.- Returns:
- the base64 representation of the object.
-
toString
Must be synchronized with#fromString(String)method.
-