Class RelationshipImpl

java.lang.Object
org.wikirate4j.entitities.CardImpl
org.wikirate4j.entitities.RelationshipImpl
All Implemented Interfaces:
Card, Relationship

public class RelationshipImpl extends CardImpl implements Relationship
Author:
Vasiliki Gkatziaki
  • Method Details

    • getMetricId

      public Long getMetricId()
      Description copied from interface: Relationship
      The metric identifier the answer refers to
      Specified by:
      getMetricId in interface Relationship
      Returns:
      the metric identifier
    • getInverseMetricId

      public Long getInverseMetricId()
      Description copied from interface: Relationship
      Each Relationship Metric has an inverse Relationship Metric. This method returns the identifier of the inverse relationship metric of the relationship metric the answer is referring to.
      Specified by:
      getInverseMetricId in interface Relationship
      Returns:
      the inverse metric identifier
    • getSubjectCompanyId

      public Long getSubjectCompanyId()
      Description copied from interface: Relationship
      Relationships have the form of <subject company><relationship><object company> e.g. <Nike Inc><is a competitor of><Adidas AG> This method returns the identifier of the subject company of the relationship
      Specified by:
      getSubjectCompanyId in interface Relationship
      Returns:
      the identifier of the subject company
    • getObjectCompanyId

      public Long getObjectCompanyId()
      Description copied from interface: Relationship
      Relationships have the form of <subject company><relationship><object company> e.g. <Nike Inc><is a competitor of><Adidas AG> This method returns the identifier of the object company of the relationship
      Specified by:
      getObjectCompanyId in interface Relationship
      Returns:
      the identifier of the object company
    • getSubjectCompany

      public String getSubjectCompany()
      Description copied from interface: Relationship
      Relationships have the form of <subject company><relationship><object company> e.g. <Nike Inc><is a competitor of><Adidas AG> This method returns the name of the subject company of the relationship
      Specified by:
      getSubjectCompany in interface Relationship
      Returns:
      the name of the subject company
    • getObjectCompany

      public String getObjectCompany()
      Description copied from interface: Relationship
      Relationships have the form of <subject company><relationship><object company> e.g. <Nike Inc><is a competitor of><Adidas AG> This method returns the name of the object company of the relationship
      Specified by:
      getObjectCompany in interface Relationship
      Returns:
      the name of the object company
    • getYear

      public Integer getYear()
      Description copied from interface: Relationship
      Each relationship answer is referred to a specific year
      Specified by:
      getYear in interface Relationship
      Returns:
      the year the relationship answer is referring to
    • getValue

      public <T> T getValue(Class<T> classType)
      Description copied from interface: Relationship
      Each Answer on a question (metric) has a value and the same applies on the relationship answers. This method returns the value given the class type of the value by the user.
      Specified by:
      getValue in interface Relationship
      Type Parameters:
      T -
      Parameters:
      classType -
      Returns:
      the value transformed in the given classType
    • getValue

      public String getValue()
      Description copied from interface: Relationship
      Each Answer on a question (metric) has a value and the same applies on the relationship answers. This method returns the answer value as a string.
      Specified by:
      getValue in interface Relationship
      Returns:
      the answer value
    • getRecordURL

      public String getRecordURL()
      Description copied from interface: Relationship
      Each Answer also provides the record url which the user can call to get all the answers of the company on the question (metric) the answer is referring to
      Specified by:
      getRecordURL in interface Relationship
      Returns:
      the url of the answers record
    • getSources

      public List<Source> getSources()
      Description copied from interface: Relationship
      Each Answer must cite one or more sources. The sources can link to a website or document that the answer came from.
      Specified by:
      getSources in interface Relationship
      Returns:
      a list of sources
    • getCheckedBy

      public CheckedBy getCheckedBy()
      Description copied from interface: Relationship
      Users are able to flag a answer to request a check in case the have doubts that the answer is correct.
      Specified by:
      getCheckedBy in interface Relationship
      Returns:
      CheckedBy information about the checks done on the answer, if any.
    • getComments

      public String getComments()
      Description copied from interface: Relationship
      Comments left on the answer
      Specified by:
      getComments in interface Relationship
      Returns:
      the comments as a string
    • toJson

      public org.json.JSONObject toJson()
      Specified by:
      toJson in interface Card
      Overrides:
      toJson in class CardImpl
      Returns:
      the object as json
    • toString

      public String toString()
      Overrides:
      toString in class Object