Class Equality
java.lang.Object
org.wikidata.wdtk.datamodel.helpers.Equality
Static class for checking the equality of arbitrary data objects using only
their interfaces. This can be used to implement the equals() method of
arbitrary interface implementations. More efficient solutions might exist if
the object that implements an interface is of a specific known type, but the
methods here could always be used as a fallback or default.
Note that it is desired that different implementations of the same interface are treated as equal if they contain the same data.
- Author:
- Markus Kroetzsch
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanequalsAliasUpdate(AliasUpdate o1, Object o2) Returnstrueif the twoAliasUpdateobjects contain exactly the same data.static booleanequalsClaim(Claim o1, Object o2) Returnstrueif the parameters are twoClaimobjects with exactly the same data.static booleanReturnstrueif the parameters are twoDatatypeIdValueobjects with exactly the same data.static booleanequalsEntityIdValue(EntityIdValue o1, Object o2) Returnstrueif the parameters are twoEntityIdValueobjects with exactly the same data.static booleanReturnstrueif the parameters are twoEntityRedirectDocumentobjects with exactly the same data.static booleanequalsFormDocument(FormDocument o1, Object o2) Returnstrueif the parameters are twoFormDocumentobjects with exactly the same data.static booleanequalsFormUpdate(FormUpdate o1, Object o2) Returnstrueif the twoFormUpdateobjects contain exactly the same data.static booleanReturnstrueif the parameters are twoGlobeCoordinatesValueobjects with exactly the same data.static booleanequalsItemDocument(ItemDocument o1, Object o2) Returnstrueif the parameters are twoItemDocumentobjects with exactly the same data.static booleanequalsItemUpdate(ItemUpdate o1, Object o2) Returnstrueif the twoItemUpdateobjects contain exactly the same data.static booleanequalsLexemeDocument(LexemeDocument o1, Object o2) Returnstrueif the parameters are twoLexemeDocumentobjects with exactly the same data.static booleanequalsLexemeUpdate(LexemeUpdate o1, Object o2) Returnstrueif the twoLexemeUpdateobjects contain exactly the same data.static booleanReturnstrueif the parameters are twoMediaInfoDocumentobjects with exactly the same data.static booleanReturnstrueif the twoMediaInfoUpdateobjects contain exactly the same data.static booleanReturnstrueif the parameters are twoMonolingualTextValueobjects with exactly the same data.static booleanequalsNoValueSnak(NoValueSnak o1, Object o2) Returnstrueif the parameters are twoNoValueSnakobjects with exactly the same data.static booleanReturnstrueif the parameters are twoPropertyDocumentobjects with exactly the same data.static booleanequalsPropertyUpdate(PropertyUpdate o1, Object o2) Returnstrueif the twoPropertyUpdateobjects contain exactly the same data.static booleanequalsQuantityValue(QuantityValue o1, Object o2) Returnstrueif the parameters are twoQuantityValueobjects with exactly the same data.static booleanequalsReference(Reference o1, Object o2) Returnstrueif the parameters are twoReferenceobjects with exactly the same data.static booleanequalsSenseDocument(SenseDocument o1, Object o2) Returnstrueif the parameters are twoSenseDocumentobjects with exactly the same data.static booleanequalsSenseUpdate(SenseUpdate o1, Object o2) Returnstrueif the twoSenseUpdateobjects contain exactly the same data.static booleanequalsSiteLink(SiteLink o1, Object o2) Returnstrueif the parameters are twoSiteLinkobjects with exactly the same data.static booleanequalsSnakGroup(SnakGroup o1, Object o2) Returnstrueif the parameters are twoSnakGroupobjects with exactly the same data.static booleanequalsSomeValueSnak(SomeValueSnak o1, Object o2) Returnstrueif the parameters are twoSomeValueSnakobjects with exactly the same data.static booleanequalsStatement(Statement o1, Object o2) Returnstrueif the parameters are twoStatementobjects with exactly the same data.static booleanequalsStatementGroup(StatementGroup o1, Object o2) Returnstrueif the parameters are twoStatementGroupobjects with exactly the same data.static booleanReturnstrueif the twoStatementUpdateobjects contain exactly the same data.static booleanequalsStringValue(StringValue o1, Object o2) Returnstrueif the parameters are twoStringValueobjects with exactly the same data.static booleanequalsTermUpdate(TermUpdate o1, Object o2) Returnstrueif the twoTermUpdateobjects contain exactly the same data.static booleanequalsTimeValue(TimeValue o1, Object o2) Returnstrueif the parameters are twoTimeValueobjects with exactly the same data.static booleanequalsValueSnak(ValueSnak o1, Object o2) Returnstrueif the parameters are twoValueSnakobjects with exactly the same data.
-
Constructor Details
-
Equality
public Equality()
-
-
Method Details
-
equalsEntityIdValue
Returnstrueif the parameters are twoEntityIdValueobjects with exactly the same data. It does not matter if they are different implementations of the interface as long as their content is the same.- Parameters:
o1- the first object to compareo2- the second object to compare- Returns:
trueif both objects are equal
-
equalsDatatypeIdValue
Returnstrueif the parameters are twoDatatypeIdValueobjects with exactly the same data. It does not matter if they are different implementations of the interface as long as their content is the same.- Parameters:
o1- the first object to compareo2- the second object to compare- Returns:
trueif both objects are equal
-
equalsTimeValue
Returnstrueif the parameters are twoTimeValueobjects with exactly the same data. It does not matter if they are different implementations of the interface as long as their content is the same.- Parameters:
o1- the first object to compareo2- the second object to compare- Returns:
trueif both objects are equal
-
equalsGlobeCoordinatesValue
Returnstrueif the parameters are twoGlobeCoordinatesValueobjects with exactly the same data. It does not matter if they are different implementations of the interface as long as their content is the same.- Parameters:
o1- the first object to compareo2- the second object to compare- Returns:
trueif both objects are equal
-
equalsStringValue
Returnstrueif the parameters are twoStringValueobjects with exactly the same data. It does not matter if they are different implementations of the interface as long as their content is the same.- Parameters:
o1- the first object to compareo2- the second object to compare- Returns:
trueif both objects are equal
-
equalsMonolingualTextValue
Returnstrueif the parameters are twoMonolingualTextValueobjects with exactly the same data. It does not matter if they are different implementations of the interface as long as their content is the same.- Parameters:
o1- the first object to compareo2- the second object to compare- Returns:
trueif both objects are equal
-
equalsQuantityValue
Returnstrueif the parameters are twoQuantityValueobjects with exactly the same data. It does not matter if they are different implementations of the interface as long as their content is the same.- Parameters:
o1- the first object to compareo2- the second object to compare- Returns:
trueif both objects are equal
-
equalsValueSnak
Returnstrueif the parameters are twoValueSnakobjects with exactly the same data. It does not matter if they are different implementations of the interface as long as their content is the same.- Parameters:
o1- the first object to compareo2- the second object to compare- Returns:
trueif both objects are equal
-
equalsSomeValueSnak
Returnstrueif the parameters are twoSomeValueSnakobjects with exactly the same data. It does not matter if they are different implementations of the interface as long as their content is the same.- Parameters:
o1- the first object to compareo2- the second object to compare- Returns:
trueif both objects are equal
-
equalsNoValueSnak
Returnstrueif the parameters are twoNoValueSnakobjects with exactly the same data. It does not matter if they are different implementations of the interface as long as their content is the same.- Parameters:
o1- the first object to compareo2- the second object to compare- Returns:
trueif both objects are equal
-
equalsSnakGroup
Returnstrueif the parameters are twoSnakGroupobjects with exactly the same data. It does not matter if they are different implementations of the interface as long as their content is the same.- Parameters:
o1- the first object to compareo2- the second object to compare- Returns:
trueif both objects are equal
-
equalsClaim
Returnstrueif the parameters are twoClaimobjects with exactly the same data. It does not matter if they are different implementations of the interface as long as their content is the same.- Parameters:
o1- the first object to compareo2- the second object to compare- Returns:
trueif both objects are equal
-
equalsReference
Returnstrueif the parameters are twoReferenceobjects with exactly the same data. It does not matter if they are different implementations of the interface as long as their content is the same.- Parameters:
o1- the first object to compareo2- the second object to compare- Returns:
trueif both objects are equal
-
equalsStatement
Returnstrueif the parameters are twoStatementobjects with exactly the same data. It does not matter if they are different implementations of the interface as long as their content is the same.- Parameters:
o1- the first object to compareo2- the second object to compare- Returns:
trueif both objects are equal
-
equalsStatementGroup
Returnstrueif the parameters are twoStatementGroupobjects with exactly the same data. It does not matter if they are different implementations of the interface as long as their content is the same. Note that this includes the statement id, so that two statement objects that "say the same thing" might still be unequal if they have different ids.- Parameters:
o1- the first object to compareo2- the second object to compare- Returns:
trueif both objects are equal
-
equalsSiteLink
Returnstrueif the parameters are twoSiteLinkobjects with exactly the same data. It does not matter if they are different implementations of the interface as long as their content is the same.- Parameters:
o1- the first object to compareo2- the second object to compare- Returns:
trueif both objects are equal
-
equalsPropertyDocument
Returnstrueif the parameters are twoPropertyDocumentobjects with exactly the same data. It does not matter if they are different implementations of the interface as long as their content is the same.- Parameters:
o1- the first object to compareo2- the second object to compare- Returns:
trueif both objects are equal
-
equalsItemDocument
Returnstrueif the parameters are twoItemDocumentobjects with exactly the same data. It does not matter if they are different implementations of the interface as long as their content is the same.- Parameters:
o1- the first object to compareo2- the second object to compare- Returns:
trueif both objects are equal
-
equalsLexemeDocument
Returnstrueif the parameters are twoLexemeDocumentobjects with exactly the same data. It does not matter if they are different implementations of the interface as long as their content is the same.- Parameters:
o1- the first object to compareo2- the second object to compare- Returns:
trueif both objects are equal
-
equalsFormDocument
Returnstrueif the parameters are twoFormDocumentobjects with exactly the same data. It does not matter if they are different implementations of the interface as long as their content is the same.- Parameters:
o1- the first object to compareo2- the second object to compare- Returns:
trueif both objects are equal
-
equalsSenseDocument
Returnstrueif the parameters are twoSenseDocumentobjects with exactly the same data. It does not matter if they are different implementations of the interface as long as their content is the same.- Parameters:
o1- the first object to compareo2- the second object to compare- Returns:
trueif both objects are equal
-
equalsMediaInfoDocument
Returnstrueif the parameters are twoMediaInfoDocumentobjects with exactly the same data. It does not matter if they are different implementations of the interface as long as their content is the same.- Parameters:
o1- the first object to compareo2- the second object to compare- Returns:
trueif both objects are equal
-
equalsEntityRedirectDocument
Returnstrueif the parameters are twoEntityRedirectDocumentobjects with exactly the same data. It does not matter if they are different implementations of the interface as long as their content is the same.- Parameters:
o1- the first object to compareo2- the second object to compare- Returns:
trueif both objects are equal
-
equalsTermUpdate
Returnstrueif the twoTermUpdateobjects contain exactly the same data. It does not matter whether they are different implementations of the interface as long as their content is the same.- Parameters:
o1- the first object to compareo2- the second object to compare- Returns:
trueif both objects are equal
-
equalsAliasUpdate
Returnstrueif the twoAliasUpdateobjects contain exactly the same data. It does not matter whether they are different implementations of the interface as long as their content is the same.- Parameters:
o1- the first object to compareo2- the second object to compare- Returns:
trueif both objects are equal
-
equalsStatementUpdate
Returnstrueif the twoStatementUpdateobjects contain exactly the same data. It does not matter whether they are different implementations of the interface as long as their content is the same.- Parameters:
o1- the first object to compareo2- the second object to compare- Returns:
trueif both objects are equal
-
equalsMediaInfoUpdate
Returnstrueif the twoMediaInfoUpdateobjects contain exactly the same data. It does not matter whether they are different implementations of the interface as long as their content is the same.- Parameters:
o1- the first object to compareo2- the second object to compare- Returns:
trueif both objects are equal
-
equalsItemUpdate
Returnstrueif the twoItemUpdateobjects contain exactly the same data. It does not matter whether they are different implementations of the interface as long as their content is the same.- Parameters:
o1- the first object to compareo2- the second object to compare- Returns:
trueif both objects are equal
-
equalsPropertyUpdate
Returnstrueif the twoPropertyUpdateobjects contain exactly the same data. It does not matter whether they are different implementations of the interface as long as their content is the same.- Parameters:
o1- the first object to compareo2- the second object to compare- Returns:
trueif both objects are equal
-
equalsSenseUpdate
Returnstrueif the twoSenseUpdateobjects contain exactly the same data. It does not matter whether they are different implementations of the interface as long as their content is the same.- Parameters:
o1- the first object to compareo2- the second object to compare- Returns:
trueif both objects are equal
-
equalsFormUpdate
Returnstrueif the twoFormUpdateobjects contain exactly the same data. It does not matter whether they are different implementations of the interface as long as their content is the same.- Parameters:
o1- the first object to compareo2- the second object to compare- Returns:
trueif both objects are equal
-
equalsLexemeUpdate
Returnstrueif the twoLexemeUpdateobjects contain exactly the same data. It does not matter whether they are different implementations of the interface as long as their content is the same.- Parameters:
o1- the first object to compareo2- the second object to compare- Returns:
trueif both objects are equal
-