Class Answer
java.lang.Object
io.jenkins.plugins.interactiveinput.model.Answer
- All Implemented Interfaces:
Serializable
An immutable record of a human's answer to a
Question.
Exactly one of getChoiceId(), getFreeText() or getParameterValues()
is normally set. Two special choice ids resolve the input without a positive answer while still
continuing the pipeline (an outright abort uses the store's abort path, not an answer):
__deny__ (a human denied but chose to continue) and __skip__ (an automation skipped
the input). The step returns the sentinel verbatim so the pipeline can branch on it.
When the question declared input-style parameters (B24), the submitted values are held in
getParameterValues() and returned to the pipeline with the built-in input step's
contract (a single parameter returns its value; several return a name→value map).
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
DENY_CHOICE_ID
Sentinel choice id for "denied, but continue the pipeline" (the modal's "Continue" action).- See Also:
-
SKIP_CHOICE_ID
Sentinel choice id for "skip this input" (primarily for automation/AI answering via REST).- See Also:
-
-
Constructor Details
-
Answer
public Answer(@NonNull String questionId, @CheckForNull String choiceId, @CheckForNull String freeText, @NonNull String answeredBy, long answeredTs) - Parameters:
questionId- the answered question's id (required)choiceId- the picked choice id, ornullif a free-text answerfreeText- the free-text answer, ornullif a choice was pickedansweredBy- Jenkins user id of the submitter (or"SYSTEM"for internal paths)answeredTs- epoch millis when the answer was recorded
-
Answer
public Answer(@NonNull String questionId, @CheckForNull String choiceId, @CheckForNull String freeText, @CheckForNull Map<String, Object> parameterValues, @NonNull String answeredBy, long answeredTs) Canonical constructor;parameterValuescarries aninput-style answer (B24).
-
-
Method Details
-
getQuestionId
-
getChoiceId
-
getFreeText
-
getParameterValues
- Returns:
- the submitted
input-style parameter values (name→value), ornull.
-
isParameterized
public boolean isParameterized()- Returns:
trueif this answer carriesinput-style parameter values (B24).
-
getAnsweredBy
-
getAnsweredTs
public long getAnsweredTs() -
isDeny
public boolean isDeny()- Returns:
trueif this answer is the sentinel "deny (continue)" answer.
-
isSkip
public boolean isSkip()- Returns:
trueif this answer is the sentinel "skip" answer.
-
toStepReturnValue
Resolve the value handed back to the pipeline by theaskInteractivestep. -
toJson
@NonNull public net.sf.json.JSONObject toJson()
-