Class ReferenceBuilder
java.lang.Object
org.wikidata.wdtk.datamodel.helpers.AbstractDataObjectBuilder<ReferenceBuilder,Reference>
org.wikidata.wdtk.datamodel.helpers.ReferenceBuilder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Returns the object that has been built.Returns a list ofSnakGroupobjects for the currently stored snaks.getSnakList(PropertyIdValue propertyIdValue) Returns the list ofSnakobjects for a given property.protected ReferenceBuildergetThis()Returns the current object with the correct builder type.static ReferenceBuilderStarts the construction of aReference.withNoValue(PropertyIdValue propertyIdValue) Adds aNoValueSnakwith 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 aSomeValueSnakwith 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:AbstractDataObjectBuilderReturns the object that has been built.- Specified by:
buildin 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 aSomeValueSnakwith the given property to the constructed reference.Note that it might not be meaningful to use
SomeValueSnakin a reference, depending on the policies of the wiki.- Parameters:
propertyIdValue- the property of the snak- Returns:
- builder object to continue construction
-
withNoValue
Adds aNoValueSnakwith the given property to the constructed reference.Note that it might not be meaningful to use
NoValueSnakin 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 ofNoValueSnakentries for every reference!- Parameters:
propertyIdValue- the property of the snak- Returns:
- builder object to continue construction
-
getThis
Description copied from class:AbstractDataObjectBuilderReturns the current object with the correct builder type.- Specified by:
getThisin classAbstractDataObjectBuilder<ReferenceBuilder,Reference> - Returns:
- this
-
getSnakGroups
Returns a list ofSnakGroupobjects for the currently stored snaks.- Returns:
-
getSnakList
Returns the list ofSnakobjects for a given property.- Parameters:
propertyIdValue-- Returns:
-