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
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
equalsAliasUpdate
(AliasUpdate o1, Object o2) Returnstrue
if the twoAliasUpdate
objects contain exactly the same data.static boolean
equalsClaim
(Claim o1, Object o2) Returnstrue
if the parameters are twoClaim
objects with exactly the same data.static boolean
Returnstrue
if the parameters are twoDatatypeIdValue
objects with exactly the same data.static boolean
equalsEntityIdValue
(EntityIdValue o1, Object o2) Returnstrue
if the parameters are twoEntityIdValue
objects with exactly the same data.static boolean
Returnstrue
if the parameters are twoEntityRedirectDocument
objects with exactly the same data.static boolean
equalsFormDocument
(FormDocument o1, Object o2) Returnstrue
if the parameters are twoFormDocument
objects with exactly the same data.static boolean
equalsFormUpdate
(FormUpdate o1, Object o2) Returnstrue
if the twoFormUpdate
objects contain exactly the same data.static boolean
Returnstrue
if the parameters are twoGlobeCoordinatesValue
objects with exactly the same data.static boolean
equalsItemDocument
(ItemDocument o1, Object o2) Returnstrue
if the parameters are twoItemDocument
objects with exactly the same data.static boolean
equalsItemUpdate
(ItemUpdate o1, Object o2) Returnstrue
if the twoItemUpdate
objects contain exactly the same data.static boolean
equalsLexemeDocument
(LexemeDocument o1, Object o2) Returnstrue
if the parameters are twoLexemeDocument
objects with exactly the same data.static boolean
equalsLexemeUpdate
(LexemeUpdate o1, Object o2) Returnstrue
if the twoLexemeUpdate
objects contain exactly the same data.static boolean
Returnstrue
if the parameters are twoMediaInfoDocument
objects with exactly the same data.static boolean
Returnstrue
if the twoMediaInfoUpdate
objects contain exactly the same data.static boolean
Returnstrue
if the parameters are twoMonolingualTextValue
objects with exactly the same data.static boolean
equalsNoValueSnak
(NoValueSnak o1, Object o2) Returnstrue
if the parameters are twoNoValueSnak
objects with exactly the same data.static boolean
Returnstrue
if the parameters are twoPropertyDocument
objects with exactly the same data.static boolean
equalsPropertyUpdate
(PropertyUpdate o1, Object o2) Returnstrue
if the twoPropertyUpdate
objects contain exactly the same data.static boolean
equalsQuantityValue
(QuantityValue o1, Object o2) Returnstrue
if the parameters are twoQuantityValue
objects with exactly the same data.static boolean
equalsReference
(Reference o1, Object o2) Returnstrue
if the parameters are twoReference
objects with exactly the same data.static boolean
equalsSenseDocument
(SenseDocument o1, Object o2) Returnstrue
if the parameters are twoSenseDocument
objects with exactly the same data.static boolean
equalsSenseUpdate
(SenseUpdate o1, Object o2) Returnstrue
if the twoSenseUpdate
objects contain exactly the same data.static boolean
equalsSiteLink
(SiteLink o1, Object o2) Returnstrue
if the parameters are twoSiteLink
objects with exactly the same data.static boolean
equalsSnakGroup
(SnakGroup o1, Object o2) Returnstrue
if the parameters are twoSnakGroup
objects with exactly the same data.static boolean
equalsSomeValueSnak
(SomeValueSnak o1, Object o2) Returnstrue
if the parameters are twoSomeValueSnak
objects with exactly the same data.static boolean
equalsStatement
(Statement o1, Object o2) Returnstrue
if the parameters are twoStatement
objects with exactly the same data.static boolean
equalsStatementGroup
(StatementGroup o1, Object o2) Returnstrue
if the parameters are twoStatementGroup
objects with exactly the same data.static boolean
Returnstrue
if the twoStatementUpdate
objects contain exactly the same data.static boolean
equalsStringValue
(StringValue o1, Object o2) Returnstrue
if the parameters are twoStringValue
objects with exactly the same data.static boolean
equalsTermUpdate
(TermUpdate o1, Object o2) Returnstrue
if the twoTermUpdate
objects contain exactly the same data.static boolean
equalsTimeValue
(TimeValue o1, Object o2) Returnstrue
if the parameters are twoTimeValue
objects with exactly the same data.static boolean
equalsValueSnak
(ValueSnak o1, Object o2) Returnstrue
if the parameters are twoValueSnak
objects with exactly the same data.
-
Constructor Details
-
Equality
public Equality()
-
-
Method Details
-
equalsEntityIdValue
Returnstrue
if the parameters are twoEntityIdValue
objects 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:
true
if both objects are equal
-
equalsDatatypeIdValue
Returnstrue
if the parameters are twoDatatypeIdValue
objects 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:
true
if both objects are equal
-
equalsTimeValue
Returnstrue
if the parameters are twoTimeValue
objects 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:
true
if both objects are equal
-
equalsGlobeCoordinatesValue
Returnstrue
if the parameters are twoGlobeCoordinatesValue
objects 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:
true
if both objects are equal
-
equalsStringValue
Returnstrue
if the parameters are twoStringValue
objects 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:
true
if both objects are equal
-
equalsMonolingualTextValue
Returnstrue
if the parameters are twoMonolingualTextValue
objects 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:
true
if both objects are equal
-
equalsQuantityValue
Returnstrue
if the parameters are twoQuantityValue
objects 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:
true
if both objects are equal
-
equalsValueSnak
Returnstrue
if the parameters are twoValueSnak
objects 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:
true
if both objects are equal
-
equalsSomeValueSnak
Returnstrue
if the parameters are twoSomeValueSnak
objects 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:
true
if both objects are equal
-
equalsNoValueSnak
Returnstrue
if the parameters are twoNoValueSnak
objects 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:
true
if both objects are equal
-
equalsSnakGroup
Returnstrue
if the parameters are twoSnakGroup
objects 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:
true
if both objects are equal
-
equalsClaim
Returnstrue
if the parameters are twoClaim
objects 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:
true
if both objects are equal
-
equalsReference
Returnstrue
if the parameters are twoReference
objects 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:
true
if both objects are equal
-
equalsStatement
Returnstrue
if the parameters are twoStatement
objects 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:
true
if both objects are equal
-
equalsStatementGroup
Returnstrue
if the parameters are twoStatementGroup
objects 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:
true
if both objects are equal
-
equalsSiteLink
Returnstrue
if the parameters are twoSiteLink
objects 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:
true
if both objects are equal
-
equalsPropertyDocument
Returnstrue
if the parameters are twoPropertyDocument
objects 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:
true
if both objects are equal
-
equalsItemDocument
Returnstrue
if the parameters are twoItemDocument
objects 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:
true
if both objects are equal
-
equalsLexemeDocument
Returnstrue
if the parameters are twoLexemeDocument
objects 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:
true
if both objects are equal
-
equalsFormDocument
Returnstrue
if the parameters are twoFormDocument
objects 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:
true
if both objects are equal
-
equalsSenseDocument
Returnstrue
if the parameters are twoSenseDocument
objects 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:
true
if both objects are equal
-
equalsMediaInfoDocument
Returnstrue
if the parameters are twoMediaInfoDocument
objects 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:
true
if both objects are equal
-
equalsEntityRedirectDocument
Returnstrue
if the parameters are twoEntityRedirectDocument
objects 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:
true
if both objects are equal
-
equalsTermUpdate
Returnstrue
if the twoTermUpdate
objects 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:
true
if both objects are equal
-
equalsAliasUpdate
Returnstrue
if the twoAliasUpdate
objects 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:
true
if both objects are equal
-
equalsStatementUpdate
Returnstrue
if the twoStatementUpdate
objects 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:
true
if both objects are equal
-
equalsMediaInfoUpdate
Returnstrue
if the twoMediaInfoUpdate
objects 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:
true
if both objects are equal
-
equalsItemUpdate
Returnstrue
if the twoItemUpdate
objects 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:
true
if both objects are equal
-
equalsPropertyUpdate
Returnstrue
if the twoPropertyUpdate
objects 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:
true
if both objects are equal
-
equalsSenseUpdate
Returnstrue
if the twoSenseUpdate
objects 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:
true
if both objects are equal
-
equalsFormUpdate
Returnstrue
if the twoFormUpdate
objects 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:
true
if both objects are equal
-
equalsLexemeUpdate
Returnstrue
if the twoLexemeUpdate
objects 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:
true
if both objects are equal
-