@Override public PropertyIdValue getProperty() { return this.snaks.get(0).getPropertyId(); }
@Override public PropertyIdValue getProperty() { return this.snaks.get(0).getPropertyId(); }
/** * Constructor. * * @param snaks * a non-empty list of snaks that use the same property */ public SnakGroupImpl(List<Snak> snaks) { if (snaks == null || snaks.isEmpty()) { throw new IllegalArgumentException("A non-empty list of Snaks must be provided to create a SnakGroup"); } PropertyIdValue property = snaks.get(0).getPropertyId(); for (Snak s : snaks) { if (!property.equals(s.getPropertyId())) { throw new IllegalArgumentException( "All snaks in a snak group must use the same property"); } } this.snaks = Collections. unmodifiableList(snaks); }
@Override public PropertyIdValue getProperty() { return statements.get(0).getMainSnak().getPropertyId(); }
/** * Constructor. * * @param snaks * a non-empty list of snaks that use the same property */ public SnakGroupImpl(List<Snak> snaks) { if (snaks == null || snaks.isEmpty()) { throw new IllegalArgumentException("A non-empty list of Snaks must be provided to create a SnakGroup"); } PropertyIdValue property = snaks.get(0).getPropertyId(); for (Snak s : snaks) { if (!property.equals(s.getPropertyId())) { throw new IllegalArgumentException( "All snaks in a snak group must use the same property"); } } this.snaks = Collections. unmodifiableList(snaks); }
@Override public PropertyIdValue getProperty() { return statements.get(0).getMainSnak().getPropertyId(); }
/** * Adds a qualifier {@link Snak} to the constructed statement. * * @param qualifier * the qualifier to add * @return builder object to continue construction */ public StatementBuilder withQualifier(Snak qualifier) { getQualifierList(qualifier.getPropertyId()).add(qualifier); return getThis(); }
/** * Adds an additional statement to the constructed document. * * @param statement * the additional statement * @return builder object to continue construction */ public T withStatement(Statement statement) { PropertyIdValue pid = statement.getMainSnak() .getPropertyId(); ArrayList<Statement> pidStatements = this.statements.get(pid); if (pidStatements == null) { pidStatements = new ArrayList<Statement>(); this.statements.put(pid, pidStatements); } pidStatements.add(statement); return getThis(); }
/** * Adds a qualifier {@link Snak} to the constructed statement. * * @param qualifier * the qualifier to add * @return builder object to continue construction */ public StatementBuilder withQualifier(Snak qualifier) { getQualifierList(qualifier.getPropertyId()).add(qualifier); return getThis(); }
/** * Constructor. * * @param statements * a non-empty list of statements that use the same subject and * main-snak property in their claim */ public StatementGroupImpl(List<Statement> statements) { Validate.notNull(statements, "A non-null list of statements must be provided to create a statement group."); Validate.isTrue(!statements.isEmpty(), "A non-empty list of statements must be provided to create a statement group."); EntityIdValue subject = statements.get(0).getSubject(); PropertyIdValue property = statements.get(0).getMainSnak().getPropertyId(); for(Statement statement : statements) { Validate.isTrue(statement.getSubject().equals(subject), "All statements of a statement group must have the same subject."); Validate.isTrue(statement.getMainSnak().getPropertyId().equals(property), "All statements of a statement group must have the same subject."); } this.statements = statements; }
/** * Adds an additional statement to the constructed document. * * @param statement * the additional statement * @return builder object to continue construction */ public T withStatement(Statement statement) { PropertyIdValue pid = statement.getMainSnak() .getPropertyId(); ArrayList<Statement> pidStatements = this.statements.get(pid); if (pidStatements == null) { pidStatements = new ArrayList<Statement>(); this.statements.put(pid, pidStatements); } pidStatements.add(statement); return getThis(); }
/** * Constructor. * * @param statements * a non-empty list of statements that use the same subject and * main-snak property in their claim */ public StatementGroupImpl(List<Statement> statements) { Validate.notNull(statements, "A non-null list of statements must be provided to create a statement group."); Validate.isTrue(!statements.isEmpty(), "A non-empty list of statements must be provided to create a statement group."); EntityIdValue subject = statements.get(0).getSubject(); PropertyIdValue property = statements.get(0).getMainSnak().getPropertyId(); for(Statement statement : statements) { Validate.isTrue(statement.getSubject().equals(subject), "All statements of a statement group must have the same subject."); Validate.isTrue(statement.getMainSnak().getPropertyId().equals(property), "All statements of a statement group must have the same subject."); } this.statements = statements; }
String pid = statement.getMainSnak().getPropertyId().getId(); if(newGroups.containsKey(pid)) { List<Statement> newGroup = new ArrayList<>(newGroups.get(pid).size());
String pid = statement.getMainSnak().getPropertyId().getId(); if(newGroups.containsKey(pid)) { List<Statement> newGroup = new ArrayList<>(newGroups.get(pid).size());
boolean found = false; for (StatementGroup sg : currentDocument.getStatementGroups()) { if (!sg.getProperty().equals(statement.getMainSnak().getPropertyId())) { continue;
boolean found = false; for (StatementGroup sg : currentDocument.getStatementGroups()) { if (!sg.getProperty().equals(statement.getMainSnak().getPropertyId())) { continue;
PropertyIdValue pid = statement.getMainSnak().getPropertyId();
PropertyIdValue pid = statement.getMainSnak().getPropertyId();
while (snaks.hasNext()) { Snak snak = snaks.next(); if ("P1535".equals(snak.getPropertyId().getId()) && ItemGadgetAuthorityControl.equals(snak .getValue())) {