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 nullIllegalArgumentException - if given invalid combination of parameterspublic boolean isEmpty()
AliasUpdateisEmpty in interface AliasUpdatetrue if the update is empty, false otherwisepublic Optional<String> getLanguageCode()
AliasUpdategetLanguageCode in interface AliasUpdateOptional.empty() when the update is
emptypublic Optional<List<MonolingualTextValue>> getRecreated()
AliasUpdategetRecreated in interface AliasUpdateOptional.empty() if aliases are not
being recreatedpublic List<MonolingualTextValue> getAdded()
AliasUpdateAliasUpdate.getRecreated() must return Optional.empty(). It is however
possible to add and remove aliases in the same update.getAdded in interface AliasUpdatepublic Set<MonolingualTextValue> getRemoved()
AliasUpdateAliasUpdate.getRecreated() must return Optional.empty(). It is
however possible to add and remove aliases in the same update.getRemoved in interface AliasUpdateCopyright © 2014–2022 Wikidata Toolkit Developers. Generated from source code published under the Apache License 2.0. For more information, see the Wikidata Toolkit homepage