public class AliasUpdateImpl extends Object implements AliasUpdate
AliasUpdate
.EMPTY
Constructor and Description |
---|
AliasUpdateImpl(List<MonolingualTextValue> recreated,
List<MonolingualTextValue> added,
Collection<MonolingualTextValue> removed)
Initializes new alias update.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
List<MonolingualTextValue> |
getAdded()
Returns aliases added in this update.
|
Optional<String> |
getLanguageCode()
Returns language code of aliases in this update.
|
Optional<List<MonolingualTextValue>> |
getRecreated()
Returns the new list of aliases that completely replaces current aliases.
|
Set<MonolingualTextValue> |
getRemoved()
Returns aliases removed in this update.
|
int |
hashCode() |
boolean |
isEmpty()
Checks whether the update is empty.
|
public AliasUpdateImpl(List<MonolingualTextValue> recreated, List<MonolingualTextValue> added, Collection<MonolingualTextValue> removed)
recreated
parameter or
added
and removed
parameters, because combination of the two
update approaches is not possible. To remove all aliases, pass empty list in
recreated
parameter.recreated
- new list of aliases that completely replaces the old ones or
null
to not recreate aliasesadded
- aliases added in this update or empty collection for no additionsremoved
- aliases removed in this update or empty collection for no removalsNullPointerException
- if added
, removed
, or any alias is null
IllegalArgumentException
- if given invalid combination of parameterspublic boolean isEmpty()
AliasUpdate
isEmpty
in interface AliasUpdate
true
if the update is empty, false
otherwisepublic Optional<String> getLanguageCode()
AliasUpdate
getLanguageCode
in interface AliasUpdate
Optional.empty()
when the update is
emptypublic Optional<List<MonolingualTextValue>> getRecreated()
AliasUpdate
getRecreated
in interface AliasUpdate
Optional.empty()
if aliases are not
being recreatedpublic List<MonolingualTextValue> getAdded()
AliasUpdate
AliasUpdate.getRecreated()
must return Optional.empty()
. It is however
possible to add and remove aliases in the same update.getAdded
in interface AliasUpdate
public Set<MonolingualTextValue> getRemoved()
AliasUpdate
AliasUpdate.getRecreated()
must return Optional.empty()
. It is
however possible to add and remove aliases in the same update.getRemoved
in interface AliasUpdate
Copyright © 2014–2024 Wikidata Toolkit Developers. Generated from source code published under the Apache License 2.0. For more information, see the Wikidata Toolkit homepage