public class LexemeUpdateBuilder extends StatementDocumentUpdateBuilder
LexemeUpdate
objects.Modifier and Type | Method and Description |
---|---|
LexemeUpdateBuilder |
addForm(FormDocument form)
Adds form to the lexeme.
|
LexemeUpdateBuilder |
addSense(SenseDocument sense)
Adds sense to the lexeme.
|
LexemeUpdateBuilder |
append(LexemeUpdate update)
Replays all changes in provided update into this builder object.
|
LexemeUpdate |
build()
Creates new
StatementDocumentUpdate object with contents of this
builder object. |
static LexemeUpdateBuilder |
forBaseRevision(LexemeDocument revision)
Creates new builder object for constructing update of given base lexeme
entity revision.
|
static LexemeUpdateBuilder |
forBaseRevisionId(LexemeIdValue lexemeId,
long revisionId)
Creates new builder object for constructing update of lexeme entity with
given revision ID.
|
static LexemeUpdateBuilder |
forEntityId(LexemeIdValue lexemeId)
Creates new builder object for constructing update of lexeme entity with
given ID.
|
LexemeUpdateBuilder |
removeForm(FormIdValue formId)
Removes existing form from the lexeme.
|
LexemeUpdateBuilder |
removeSense(SenseIdValue senseId)
Removes existing sense from the lexeme.
|
LexemeUpdateBuilder |
setLanguage(ItemIdValue language)
Sets lexeme language.
|
LexemeUpdateBuilder |
setLexicalCategory(ItemIdValue category)
Sets lexical category of the lexeme.
|
LexemeUpdateBuilder |
updateForm(FormUpdate update)
Updates existing form in the lexeme.
|
LexemeUpdateBuilder |
updateLemmas(TermUpdate update)
Updates lemmas.
|
LexemeUpdateBuilder |
updateSense(SenseUpdate update)
Updates existing sense in the lexeme.
|
LexemeUpdateBuilder |
updateStatements(StatementUpdate update)
Updates entity statements.
|
forBaseRevision, forBaseRevisionId, forEntityId
forBaseRevision
public static LexemeUpdateBuilder forBaseRevisionId(LexemeIdValue lexemeId, long revisionId)
lexemeId
- ID of the lexeme that is to be updatedrevisionId
- ID of the base lexeme revision to be updated or zero if not
availableNullPointerException
- if lexemeId
is null
IllegalArgumentException
- if lexemeId
is a placeholder IDpublic static LexemeUpdateBuilder forEntityId(LexemeIdValue lexemeId)
lexemeId
- ID of the lexeme that is to be updatedNullPointerException
- if lexemeId
is null
IllegalArgumentException
- if lexemeId
is a placeholder IDpublic static LexemeUpdateBuilder forBaseRevision(LexemeDocument revision)
revision
- base lexeme entity revision to be updatedNullPointerException
- if revision
is null
IllegalArgumentException
- if revision
has placeholder IDpublic LexemeUpdateBuilder updateStatements(StatementUpdate update)
StatementDocumentUpdateBuilder
updateStatements
in class StatementDocumentUpdateBuilder
update
- statement update, possibly emptythis
(fluent method)public LexemeUpdateBuilder setLanguage(ItemIdValue language)
language
- new lexeme languagethis
(fluent method)NullPointerException
- if language
is null
IllegalArgumentException
- if language
is an invalid IDpublic LexemeUpdateBuilder setLexicalCategory(ItemIdValue category)
category
- new lexical categorythis
(fluent method)NullPointerException
- if category
is null
IllegalArgumentException
- if category
is an invalid IDpublic LexemeUpdateBuilder updateLemmas(TermUpdate update)
update
- changes in lemmasthis
(fluent method)NullPointerException
- if update
is null
public LexemeUpdateBuilder addSense(SenseDocument sense)
sense
has an ID (perhaps because it is a
modified copy of another sense), its ID is stripped to ensure the sense is
added and no other sense is modified.sense
- new sense to addthis
(fluent method)NullPointerException
- if sense
is null
public LexemeUpdateBuilder updateSense(SenseUpdate update)
update
- update of existing sensethis
(fluent method)NullPointerException
- if update
is null
IllegalArgumentException
- if the sense does not exist in base revision (if available) or
the update cannot be applied to itIllegalStateException
- if the sense was removed by calling
removeSense(SenseIdValue)
public LexemeUpdateBuilder removeSense(SenseIdValue senseId)
updateSense(SenseUpdate)
are discarded.senseId
- ID of the removed sensethis
(fluent method)NullPointerException
- if senseId
is null
IllegalArgumentException
- if senseId
is not valid or if such ID does not exist in
base revision (if available)public LexemeUpdateBuilder addForm(FormDocument form)
form
has an ID (perhaps because it is a
modified copy of another form), its ID is stripped to ensure the form is
added and no other form is modified.form
- new form to addthis
(fluent method)NullPointerException
- if form
is null
public LexemeUpdateBuilder updateForm(FormUpdate update)
update
- update of existing formthis
(fluent method)NullPointerException
- if update
is null
IllegalArgumentException
- if the form does not exist in base revision (if available) or the
update cannot be applied to itIllegalStateException
- if the form was removed by calling
removeForm(FormIdValue)
public LexemeUpdateBuilder removeForm(FormIdValue formId)
updateForm(FormUpdate)
.
Removing the same form ID twice is silently tolerated.formId
- ID of the removed formthis
(fluent method)NullPointerException
- if formId
is null
IllegalArgumentException
- if formId
is not valid or if such ID does not exist in
current version of the lexeme document (if available)public LexemeUpdateBuilder append(LexemeUpdate update)
update
- lexeme update to replaythis
(fluent method)NullPointerException
- if update
is null
IllegalArgumentException
- if update
cannot be applied to base entity revision (if
available)public LexemeUpdate build()
StatementDocumentUpdateBuilder
StatementDocumentUpdate
object with contents of this
builder object.build
in class StatementDocumentUpdateBuilder
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