Class AnswerImpl

java.lang.Object
org.wikirate4j.entitities.CardImpl
org.wikirate4j.entitities.AnswerImpl
All Implemented Interfaces:
Answer, Card

public class AnswerImpl extends CardImpl implements Answer
Author:
Vasiliki Gkatziaki
  • Method Details

    • getMetricName

      public String getMetricName()
      Description copied from interface: Answer
      Each Answer is linked to a specific metric. The metric names consists of the metric name and the metric designer.
      Specified by:
      getMetricName in interface Answer
      Returns:
      the name of the metric the answer is linked to
    • getMetricDesigner

      public String getMetricDesigner()
      Description copied from interface: Answer
      Each Answer is linked to a specific metric. The metric names consists of the metric name and the metric designer.
      Specified by:
      getMetricDesigner in interface Answer
      Returns:
      the name of the metric designer
    • getCompany

      public String getCompany()
      Description copied from interface: Answer
      Each answer is referred to a specific company
      Specified by:
      getCompany in interface Answer
      Returns:
      the company name
    • getYear

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

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

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

      public String getRecordURL()
      Description copied from interface: Answer
      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 Answer
      Returns:
      the url of the answers record
    • getSources

      public List<SourceReference> getSources()
      Description copied from interface: Answer
      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 Answer
      Returns:
      a list of sources
    • getCheckedBy

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

      public String getComments()
      Description copied from interface: Answer
      Comments left on the answer
      Specified by:
      getComments in interface Answer
      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