Class ChangeInfoDiffer
ChangeInfo
s.
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 ChangeInfoDifference
getDifference
(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
ChangeInfoDifference
returned has the following properties:Unrepeated fields are present in the difference returned when they differ between
oldChangeInfo
andnewChangeInfo
. When there's an unrepeated field that's not aString
, primitive, or enum, its fields are only returned when they differ.Entries in
Map
fields are returned when a key is present innewChangeInfo
and notoldChangeInfo
. If a key is present in both, the diff of the value is returned.Collection
fields inChangeInfoDifference.added()
contain only items found innewChangeInfo
and notoldChangeInfo
.Collection
fields inChangeInfoDifference.removed()
contain only items found inoldChangeInfo
and notnewChangeInfo
.- Parameters:
oldChangeInfo
- the previousChangeInfo
to diff againstnewChangeInfo
newChangeInfo
- theChangeInfo
to diff againstoldChangeInfo
- Returns:
- the difference between the given
ChangeInfo
s
-