public class ReferenceBuilder extends AbstractDataObjectBuilder<ReferenceBuilder,Reference>
| Modifier | Constructor and Description |
|---|---|
protected |
ReferenceBuilder()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Reference |
build()
Returns the object that has been built.
|
protected List<SnakGroup> |
getSnakGroups()
Returns a list of
SnakGroup objects for the currently stored
snaks. |
protected ArrayList<Snak> |
getSnakList(PropertyIdValue propertyIdValue)
Returns the list of
Snak objects for a given property. |
protected ReferenceBuilder |
getThis()
Returns the current object with the correct builder type.
|
static ReferenceBuilder |
newInstance()
Starts the construction of a
Reference. |
ReferenceBuilder |
withNoValue(PropertyIdValue propertyIdValue)
Adds a
NoValueSnak with the given property to the constructed
reference. |
ReferenceBuilder |
withPropertyValue(PropertyIdValue propertyIdValue,
Value value)
Adds the given property and value to the constructed reference.
|
ReferenceBuilder |
withSomeValue(PropertyIdValue propertyIdValue)
Adds a
SomeValueSnak with the given property to the constructed
reference. |
prepareBuildpublic static ReferenceBuilder newInstance()
Reference.public Reference build()
AbstractDataObjectBuilderbuild in class AbstractDataObjectBuilder<ReferenceBuilder,Reference>public ReferenceBuilder withPropertyValue(PropertyIdValue propertyIdValue, Value value)
propertyIdValue - the property to addvalue - the value to addpublic ReferenceBuilder withSomeValue(PropertyIdValue propertyIdValue)
SomeValueSnak with the given property to the constructed
reference.
Note that it might not be meaningful to use SomeValueSnak in a
reference, depending on the policies of the wiki.
propertyIdValue - the property of the snakpublic ReferenceBuilder withNoValue(PropertyIdValue propertyIdValue)
NoValueSnak with the given property to the constructed
reference.
Note that it might not be meaningful to use NoValueSnak in a
reference. It is usually implicitly assumed that all snaks that are not
given have no value for a particular reference. Otherwise one would need
large numbers of NoValueSnak entries for every reference!
propertyIdValue - the property of the snakprotected ReferenceBuilder getThis()
AbstractDataObjectBuildergetThis in class AbstractDataObjectBuilder<ReferenceBuilder,Reference>protected List<SnakGroup> getSnakGroups()
SnakGroup objects for the currently stored
snaks.protected ArrayList<Snak> getSnakList(PropertyIdValue propertyIdValue)
Snak objects for a given property.propertyIdValue - 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