Class QuestionImpl
java.lang.Object
org.eu.zajc.akiwrapper.core.entities.impl.AbstractQuery
org.eu.zajc.akiwrapper.core.entities.impl.QuestionImpl
Note: This is an internal class and its internals are subject to change
without prior deprecation. Use with caution.
- Author:
- Marko Zajc
-
Method Summary
Modifier and TypeMethodDescriptionanswer(Akiwrapper.Answer answer) static QuestionImplfromHtml(AkiwrapperImpl akiwrapper, org.jsoup.nodes.Element gameRoot) static QuestionImplfromJson(AkiwrapperImpl akiwrapper, org.json.JSONObject json) URL to the akitude image.getText()Returns the question text that should be displayed to the user.This is an interaction method forQuestion.
Goes one question backwards, undoing the previousQuestion.answer(Answer)call.Methods inherited from class org.eu.zajc.akiwrapper.core.entities.impl.AbstractQuery
ensureCurrent, getAkiwrapper, getProgression, getStep, parseNextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eu.zajc.akiwrapper.core.entities.Query
getAkiwrapper, getProgression, getStepMethods inherited from interface org.eu.zajc.akiwrapper.core.entities.Question
getQuestion
-
Method Details
-
fromJson
@Nonnull public static QuestionImpl fromJson(@Nonnull AkiwrapperImpl akiwrapper, @Nonnull org.json.JSONObject json) -
fromHtml
public static QuestionImpl fromHtml(@Nonnull AkiwrapperImpl akiwrapper, @Nonnull org.jsoup.nodes.Element gameRoot) -
answer
Description copied from interface:QuestionThis is an interaction method forQuestion.
Submits an answer for the question and returns the nextQuery, incrementing the current step.
If there are no more questions left, this will returnnull.
Note: A singleQuestionobject can only be interacted with once. CallingQuestion.answer(Answer)orQuestion.undoAnswer()mutates the session state, so you can only call one of them once.- Specified by:
answerin interfaceQuestion- Parameters:
answer- theAkiwrapper.Answerto submit.- Returns:
- the next
Queryornullif there are none left. - See Also:
-
undoAnswer
Description copied from interface:QuestionThis is an interaction method forQuestion.
Goes one question backwards, undoing the previousQuestion.answer(Answer)call. For example, ifQuestion.getQuestion()returns a question on step5, calling this command will return the question on step4. You can call this as many times as you want, until you reach step0. Note that this will always return aQuestion, and never aGuessornull.
Note: A singleQuestionobject can only be interacted with once. CallingQuestion.answer(Answer)orQuestion.undoAnswer()mutates the session state, so you can only call one of them once.- Specified by:
undoAnswerin interfaceQuestion- Returns:
- the previous
Question. - See Also:
-
getText
Description copied from interface:QuestionReturns the question text that should be displayed to the user. This is localized to theAkiwrapper.Languageand in line with theAkiwrapper.Themeset in theAkiwrapperBuilder.Example
Is your character real? -
getAkitude
Description copied from interface:QuestionURL to the akitude image. "Akitude" is likely a portmanteau of "Akinator" and "attitude", and they represent Akinator's current confidence - previously this was calculated using a formula on the step and progression values, now it's returned by the API. On the website, the akitude is shown on the left of the question box.Example
https://en.akinator.com/assets/img/akitudes_670x1096/defi.png- Specified by:
getAkitudein interfaceQuestion- Returns:
- the akitude image URL.
-