Class ChangeInfoDiffer
ChangeInfos.
This must be in package com.google.gerrit.extensions.common for access to protected
constructors.
This assumes that every class reachable from ChangeInfo has a non-private constructor
with zero parameters and overrides the equals method.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ChangeInfoDifferencegetDifference(ChangeInfo oldChangeInfo, ChangeInfo newChangeInfo) Returns the difference between two instances ofChangeInfo.
-
Method Details
-
getDifference
public static ChangeInfoDifference getDifference(ChangeInfo oldChangeInfo, ChangeInfo newChangeInfo) Returns the difference between two instances ofChangeInfo.The
ChangeInfoDifferencereturned has the following properties:Unrepeated fields are present in the difference returned when they differ between
oldChangeInfoandnewChangeInfo. When there's an unrepeated field that's not aString, primitive, or enum, its fields are only returned when they differ.Entries in
Mapfields are returned when a key is present innewChangeInfoand notoldChangeInfo. If a key is present in both, the diff of the value is returned.Collectionfields inChangeInfoDifference.added()contain only items found innewChangeInfoand notoldChangeInfo.Collectionfields inChangeInfoDifference.removed()contain only items found inoldChangeInfoand notnewChangeInfo.- Parameters:
oldChangeInfo- the previousChangeInfoto diff againstnewChangeInfonewChangeInfo- theChangeInfoto diff againstoldChangeInfo- Returns:
- the difference between the given
ChangeInfos
-