public class JacksonStatement extends Object implements Statement
Statement. In JSON, the corresponding
structures are referred to as "claim".
Like all Jackson objects, it is not technically immutable, but it is strongly recommended to treat it as such in all contexts: the setters are for Jackson; never call them in your code.
| Constructor and Description |
|---|
JacksonStatement()
Constructor.
|
JacksonStatement(String id,
JacksonSnak mainsnak)
TODO review the utility of this constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
Claim |
getClaim()
Get the Claim object that this statement refers to.
|
String |
getJsonType()
Returns the value for the "type" field used in JSON.
|
JacksonSnak |
getMainsnak()
Returns the main snak of the claim of this statement.
|
List<String> |
getPropertyOrder()
Returns the list of property ids used to order qualifiers as found in
JSON.
|
Map<String,List<JacksonSnak>> |
getQualifiers()
Returns the qualifiers of the claim of this statement.
|
StatementRank |
getRank() |
List<? extends Reference> |
getReferences()
Get a list of references for this Statement.
|
String |
getStatementId()
Return the id used to identify this statement.
|
int |
hashCode() |
void |
setMainsnak(JacksonSnak mainsnak)
Sets the main snak of the claim of this statement to the given value.
|
void |
setPropertyOrder(List<String> propertyOrder)
Sets the list of property ids to the given value.
|
void |
setQualifiers(Map<String,List<JacksonSnak>> qualifiers)
Sets the qualifiers to the given value.
|
void |
setRank(StatementRank rank)
Sets the statement rank to the given value.
|
void |
setReferences(List<JacksonReference> references)
Sets the references to the given value.
|
void |
setStatementId(String id)
Sets the statement id to the given value.
|
String |
toString() |
public JacksonStatement()
public JacksonStatement(String id, JacksonSnak mainsnak)
id - mainsnak - public String getJsonType()
public Claim getClaim()
Statementpublic StatementRank getRank()
getRank in interface StatementStatementRankpublic void setRank(StatementRank rank)
rank - new valuepublic List<? extends Reference> getReferences()
StatementgetReferences in interface Statementpublic void setReferences(List<JacksonReference> references)
references - new valuepublic String getStatementId()
StatementStatement ids are used by Wikibase to allow certain interactions though the API, especially the atomic modification of Statements (modifications of statements can be viewed as deletions followed by insertions, but doing this in several steps though the API is not practical). In the current Wikibase implementation, the id is a string that begins with the (lowercased) local ID of the subject of the statement, followed by a dollar sign and a randomly generated UUID. Thus statements of different subjects can never have the same id, and it is extremely unlikely that two statements of the one subject ever have the same id. However, it is possible that two statements with the same content differ in their id, since the id is not based on the content.
Callers should not make any assumptions about the stability of statement ids over time, or about the internal format of the ids.
getStatementId in interface Statementpublic void setStatementId(String id)
id - new valuepublic JacksonSnak getMainsnak()
getClaim().public void setMainsnak(JacksonSnak mainsnak)
mainsnak - new valuepublic Map<String,List<JacksonSnak>> getQualifiers()
getClaim().public void setQualifiers(Map<String,List<JacksonSnak>> qualifiers)
qualifiers - new valuepublic void setPropertyOrder(List<String> propertyOrder)
propertyOrder - new valuepublic List<String> getPropertyOrder()
Copyright © 2014–2015 Wikidata Toolkit Developers. Generated from source code published under the Apache License 2.0. For more information, see the Wikidata Toolkit homepage