/** * Returns a human-readable string representation of the given object. * * @see java.lang.Object#toString() * @param o * the object to represent as string * @return a string representation of the object */ public static String toString(Claim o) { StringBuilder sb = new StringBuilder(); sb.append(o.getSubject()).append(": "); sb.append(o.getMainSnak().toString()).append("\n"); for (SnakGroup s : o.getQualifiers()) { sb.append(toString(s)); } return sb.toString(); }
/** * Returns a hash code for the given object. * * @see java.lang.Object#hashCode() * @param o * the object to create a hash for * @return the hash code of the object */ public static int hashCode(Claim o) { int result; result = o.getSubject().hashCode(); result = prime * result + o.getMainSnak().hashCode(); result = prime * result + o.getQualifiers().hashCode(); return result; }
/** * Returns a hash code for the given object. * * @see java.lang.Object#hashCode() * @param o * the object to create a hash for * @return the hash code of the object */ public static int hashCode(Claim o) { int result; result = o.getSubject().hashCode(); result = prime * result + o.getMainSnak().hashCode(); result = prime * result + o.getQualifiers().hashCode(); return result; }
/** * Returns a human-readable string representation of the given object. * * @see java.lang.Object#toString() * @param o * the object to represent as string * @return a string representation of the object */ public static String toString(Claim o) { StringBuilder sb = new StringBuilder(); sb.append(o.getSubject()).append(": "); sb.append(o.getMainSnak().toString()).append("\n"); for (SnakGroup s : o.getQualifiers()) { sb.append(toString(s)); } return sb.toString(); }
/** * Get the URI for the given statement. * * @param statement * the statement for which to create a URI * @return the URI */ public static String getStatementUri(Statement statement) { int i = statement.getStatementId().indexOf('$') + 1; return statement.getClaim().getSubject().getIri() + "S" + statement.getStatementId().substring(i); }
/** * Returns true if the parameters are two {@link Claim} objects with exactly * the same data. It does not matter if they are different implementations * of the interface as long as their content is the same. * * @param o1 * the first object to compare * @param o2 * the second object to compare * @return true if both objects are equal */ public static boolean equalsClaim(Claim o1, Object o2) { if (o2 == null) { return false; } if (o2 == o1) { return true; } if (!(o2 instanceof Claim)) { return false; } Claim other = (Claim) o2; return o1.getSubject().equals(other.getSubject()) && o1.getMainSnak().equals(other.getMainSnak()) && o1.getQualifiers().equals(other.getQualifiers()); }
/** * Returns true if the parameters are two {@link Claim} objects with exactly * the same data. It does not matter if they are different implementations * of the interface as long as their content is the same. * * @param o1 * the first object to compare * @param o2 * the second object to compare * @return true if both objects are equal */ public static boolean equalsClaim(Claim o1, Object o2) { if (o2 == null) { return false; } if (o2 == o1) { return true; } if (!(o2 instanceof Claim)) { return false; } Claim other = (Claim) o2; return o1.getSubject().equals(other.getSubject()) && o1.getMainSnak().equals(other.getMainSnak()) && o1.getQualifiers().equals(other.getQualifiers()); }
@Override public Statement getStatement(Claim claim, List<Reference> references, StatementRank rank, String statementId) { return getStatement(claim.getSubject(), claim.getMainSnak(), claim.getQualifiers(), references, rank, statementId); }
@Override public Statement getStatement(Claim claim, List<Reference> references, StatementRank rank, String statementId) { return getStatement(claim.getSubject(), claim.getMainSnak(), claim.getQualifiers(), references, rank, statementId); }
/** * Copies a {@link Claim}. * * @param object * object to copy * @return copied object */ public Claim copy(Claim object) { return dataObjectFactory.getClaim( (EntityIdValue) visit(object.getSubject()), copy(object.getMainSnak()), copy(object.getQualifiers())); }
/** * Copies a {@link Claim}. * * @param object * object to copy * @return copied object */ public Claim copy(Claim object) { return dataObjectFactory.getClaim( (EntityIdValue) visit(object.getSubject()), copy(object.getMainSnak()), copy(object.getQualifiers())); }
Statement returnedStatement = preStatement.withSubject(statement.getClaim().getSubject()); long revisionId = getRevisionIdFromResponse(response);
Statement returnedStatement = preStatement.withSubject(statement.getClaim().getSubject()); long revisionId = getRevisionIdFromResponse(response);