Class ReferenceBuilder
java.lang.Object
org.wikidata.wdtk.datamodel.helpers.AbstractDataObjectBuilder<ReferenceBuilder,Reference>
org.wikidata.wdtk.datamodel.helpers.ReferenceBuilder
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Returns the object that has been built.Returns a list ofSnakGroup
objects for the currently stored snaks.getSnakList
(PropertyIdValue propertyIdValue) Returns the list ofSnak
objects for a given property.protected ReferenceBuilder
getThis()
Returns the current object with the correct builder type.static ReferenceBuilder
Starts the construction of aReference
.withNoValue
(PropertyIdValue propertyIdValue) Adds aNoValueSnak
with the given property to the constructed reference.withPropertyValue
(PropertyIdValue propertyIdValue, Value value) Adds the given property and value to the constructed reference.withSomeValue
(PropertyIdValue propertyIdValue) Adds aSomeValueSnak
with the given property to the constructed reference.Methods inherited from class org.wikidata.wdtk.datamodel.helpers.AbstractDataObjectBuilder
prepareBuild
-
Constructor Details
-
ReferenceBuilder
protected ReferenceBuilder()Constructor.
-
-
Method Details
-
newInstance
Starts the construction of aReference
.- Returns:
- builder object to continue construction
-
build
Description copied from class:AbstractDataObjectBuilder
Returns the object that has been built.- Specified by:
build
in classAbstractDataObjectBuilder<ReferenceBuilder,
Reference> - Returns:
- constructed object
-
withPropertyValue
Adds the given property and value to the constructed reference.- Parameters:
propertyIdValue
- the property to addvalue
- the value to add- Returns:
- builder object to continue construction
-
withSomeValue
Adds aSomeValueSnak
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.- Parameters:
propertyIdValue
- the property of the snak- Returns:
- builder object to continue construction
-
withNoValue
Adds aNoValueSnak
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 ofNoValueSnak
entries for every reference!- Parameters:
propertyIdValue
- the property of the snak- Returns:
- builder object to continue construction
-
getThis
Description copied from class:AbstractDataObjectBuilder
Returns the current object with the correct builder type.- Specified by:
getThis
in classAbstractDataObjectBuilder<ReferenceBuilder,
Reference> - Returns:
- this
-
getSnakGroups
Returns a list ofSnakGroup
objects for the currently stored snaks.- Returns:
-
getSnakList
Returns the list ofSnak
objects for a given property.- Parameters:
propertyIdValue
-- Returns:
-