java.lang.Object
org.eu.zajc.akiwrapper.core.entities.impl.AbstractQuery
org.eu.zajc.akiwrapper.core.entities.impl.GuessImpl
All Implemented Interfaces:
Guess, Query

public class GuessImpl extends AbstractQuery implements Guess
Note: This is an internal class and its internals are subject to change without prior deprecation. Use with caution.

Author:
Marko Zajc
  • Method Details

    • fromJson

      @Nonnull public static GuessImpl fromJson(@Nonnull AkiwrapperImpl akiwrapper, @Nonnull org.json.JSONObject json)
    • confirm

      public void confirm()
      Description copied from interface: Guess
      This is an interaction method for Guess.
      Confirms the Guess. This ends the session and likely affects Akinator's algorithm to associate the taken answer route with the confirmed guess, improving the guessing algorithm.
      Note: A single Guess object can only be interacted with once. Calling Guess.confirm() or Guess.reject() mutates the session state, so you can only call one of them once.
      Specified by:
      confirm in interface Guess
      See Also:
    • reject

      public Query reject()
      Description copied from interface: Guess
      This is an interaction method for Guess.
      Rejects the Guess and provides the next Query. If the next query is a question, it will have the same step as the previous one, but different text.
      Note: Rejecting a Guess does not mean the API won't propose it again. That happens quite often, in fact.
      Note: A single Guess object can only be interacted with once. Calling Guess.confirm() or Guess.reject() mutates the session state, so you can only call one of them once.
      Specified by:
      reject in interface Guess
      Returns:
      the next Query or null if there are none left.
    • getName

      public String getName()
      Description copied from interface: Guess
      Returns the name of the guessed subject. This is localized to the Akiwrapper.Language and in line with the Akiwrapper.Theme set in the AkiwrapperBuilder.
      Specified by:
      getName in interface Guess
      Returns:
      the guessed subject's name.
    • getPseudonym

      public String getPseudonym()
      Description copied from interface: Guess
      Returns the pseudonym or alternative name of the guessed subject. As a pseudonym is optional, this may be null. Please note that the pseudonym is sometimes set to a placeholder value such as "X" or "-" rather than null. This is localized to the Akiwrapper.Language and in line with the Akiwrapper.Theme set in the AkiwrapperBuilder.
      Specified by:
      getPseudonym in interface Guess
      Returns:
      the guessed subject's pseudonym.
    • getDescription

      public String getDescription()
      Description copied from interface: Guess
      Returns the description of this subject. Please note that the description is sometimes set to a placeholder value such as "X" or "-". This is localized to the Akiwrapper.Language and in line with the Akiwrapper.Theme set in the AkiwrapperBuilder.
      Specified by:
      getDescription in interface Guess
      Returns:
      the guessed subject's description.
    • getImage

      public URL getImage()
      Description copied from interface: Guess
      Returns the URL to an image of this subject, which can be a placeholder image (https://photos.clarinea.fr/BL_1_fr/none.jpg).
      Specified by:
      getImage in interface Guess
      Returns:
      the guess picture URL.
    • getId

      public String getId()
      Description copied from interface: Guess
      Returns this guess' ID. ID's are unique to each guess and can be used to track rejected guesses, because Akinator won't do that for you.
      Specified by:
      getId in interface Guess
      Returns:
      this guess' ID.
      See Also:
    • getFlagPhoto

      @Nonnull public String getFlagPhoto()