public class AliasUpdateBuilder extends Object
AliasUpdate
objects.Modifier and Type | Method and Description |
---|---|
AliasUpdateBuilder |
add(MonolingualTextValue alias)
Adds new alias.
|
AliasUpdateBuilder |
append(AliasUpdate update)
Replays all changes in provided update into this builder object.
|
AliasUpdate |
build()
Creates new
AliasUpdate object with contents of this builder object. |
static AliasUpdateBuilder |
create()
Creates new builder object for constructing alias update.
|
static AliasUpdateBuilder |
forAliases(List<MonolingualTextValue> aliases)
Creates new builder object for constructing update of given base revision
aliases.
|
AliasUpdateBuilder |
recreate(List<MonolingualTextValue> aliases)
Replaces current alias list with completely new alias list.
|
AliasUpdateBuilder |
remove(MonolingualTextValue alias)
Removed existing alias.
|
public static AliasUpdateBuilder create()
public static AliasUpdateBuilder forAliases(List<MonolingualTextValue> aliases)
Since all changes will be checked after the AliasUpdate
is passed to
TermedDocumentUpdateBuilder
anyway, it is usually unnecessary to use
this method. It is simpler to initialize the builder with create()
.
aliases
- aliases from base revision of the documentNullPointerException
- if aliases
or any of its items is null
IllegalArgumentException
- if there are duplicate items in aliases
public AliasUpdateBuilder add(MonolingualTextValue alias)
remove(MonolingualTextValue)
.
Attempt to add the same alias twice or to add alias already present in base
document (if available) is silently ignored. Adding previously removed alias
cancels the removal. If recreate(List)
was called before, this
method will add the alias to the end of the new alias list.alias
- new aliasthis
(fluent method)NullPointerException
- if alias
is null
IllegalArgumentException
- if the alias has language code inconsistent with other aliasespublic AliasUpdateBuilder remove(MonolingualTextValue alias)
add(MonolingualTextValue)
. Attempt to remove the same alias twice or
to remove alias not present in base document (if available) is silently
ignored. Removing previously added alias cancels the addition. If
recreate(List)
was called before, this method will remove the alias
from the new alias list.alias
- removed aliasthis
(fluent method)NullPointerException
- if alias
is null
IllegalArgumentException
- if the alias has language code inconsistent with other aliasespublic AliasUpdateBuilder recreate(List<MonolingualTextValue> aliases)
aliases
- new list of aliasesthis
(fluent method)NullPointerException
- if aliases
or any of its items is null
IllegalArgumentException
- if some alias has inconsistent language code or there are
duplicatespublic AliasUpdateBuilder append(AliasUpdate update)
add(MonolingualTextValue)
,
remove(MonolingualTextValue)
, and recreate(List)
methods.update
- alias update to replaythis
(fluent method)NullPointerException
- if update
is null
public AliasUpdate build()
AliasUpdate
object with contents of this builder object.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