public class TermUpdateBuilder extends Object
TermUpdate objects.| Modifier and Type | Method and Description |
|---|---|
TermUpdateBuilder |
append(TermUpdate update)
Replays all changes in provided update into this builder object.
|
TermUpdate |
build()
Creates new
TermUpdate object with contents of this builder object. |
static TermUpdateBuilder |
create()
Creates new builder object for constructing term update.
|
static TermUpdateBuilder |
forTerms(Collection<MonolingualTextValue> terms)
Creates new builder object for constructing update of given base revision
terms.
|
TermUpdateBuilder |
put(MonolingualTextValue term)
Adds or changes term.
|
TermUpdateBuilder |
remove(String languageCode)
Removes term.
|
public static TermUpdateBuilder create()
public static TermUpdateBuilder forTerms(Collection<MonolingualTextValue> terms)
Since all changes will be checked after the TermUpdate is passed to
EntityUpdateBuilder anyway, it is usually unnecessary to use this
method. It is simpler to initialize the builder with create().
terms - terms from base revision of the documentNullPointerException - if terms or any of its items is nullIllegalArgumentException - if there are duplicate items in termspublic TermUpdateBuilder put(MonolingualTextValue term)
remove(String).
If base revision terms were provided, attempt to overwrite some term with the same value will be silently ignored, resulting in empty update.
term - term to add or changethis (fluent method)NullPointerException - if term is nullpublic TermUpdateBuilder remove(String languageCode)
put(MonolingualTextValue).
If base revision terms were provided, attempts to remove missing terms will be silently ignored, resulting in empty update.
languageCode - language code of the removed termthis (fluent method)NullPointerException - if languageCode is nullIllegalArgumentException - if languageCode is blankpublic TermUpdateBuilder append(TermUpdate update)
put(MonolingualTextValue) and
remove(String) methods.update - term update to replaythis (fluent method)NullPointerException - if update is nullpublic TermUpdate build()
TermUpdate object with contents of this builder object.Copyright © 2014–2022 Wikidata Toolkit Developers. Generated from source code published under the Apache License 2.0. For more information, see the Wikidata Toolkit homepage