Class ReferenceBuilder


public class ReferenceBuilder extends AbstractDataObjectBuilder<ReferenceBuilder,Reference>
  • Constructor Details

    • ReferenceBuilder

      protected ReferenceBuilder()
      Constructor.
  • Method Details

    • newInstance

      public static ReferenceBuilder newInstance()
      Starts the construction of a Reference.
      Returns:
      builder object to continue construction
    • build

      public Reference build()
      Description copied from class: AbstractDataObjectBuilder
      Returns the object that has been built.
      Specified by:
      build in class AbstractDataObjectBuilder<ReferenceBuilder,Reference>
      Returns:
      constructed object
    • withPropertyValue

      public ReferenceBuilder withPropertyValue(PropertyIdValue propertyIdValue, Value value)
      Adds the given property and value to the constructed reference.
      Parameters:
      propertyIdValue - the property to add
      value - the value to add
      Returns:
      builder object to continue construction
    • withSomeValue

      public ReferenceBuilder withSomeValue(PropertyIdValue propertyIdValue)
      Adds a 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.

      Parameters:
      propertyIdValue - the property of the snak
      Returns:
      builder object to continue construction
    • withNoValue

      public ReferenceBuilder withNoValue(PropertyIdValue propertyIdValue)
      Adds a 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!

      Parameters:
      propertyIdValue - the property of the snak
      Returns:
      builder object to continue construction
    • getThis

      protected ReferenceBuilder getThis()
      Description copied from class: AbstractDataObjectBuilder
      Returns the current object with the correct builder type.
      Specified by:
      getThis in class AbstractDataObjectBuilder<ReferenceBuilder,Reference>
      Returns:
      this
    • getSnakGroups

      protected List<SnakGroup> getSnakGroups()
      Returns a list of SnakGroup objects for the currently stored snaks.
      Returns:
    • getSnakList

      protected ArrayList<Snak> getSnakList(PropertyIdValue propertyIdValue)
      Returns the list of Snak objects for a given property.
      Parameters:
      propertyIdValue -
      Returns: