Record Class TurnstileAnswer
java.lang.Object
java.lang.Record
org.jwcarman.who.turnstile.TurnstileAnswer
- Record Components:
success- whether Cloudflare accepts the tokenaction- the action the widget was given when the token was made, if anyhostname- the hostname the token was made on, if anychallengeTs- when the widget's challenge was solved, if givencdata- the data the page gave the widget when it made the token, if anyerrorCodes- why Cloudflare refused the token, empty when it accepted it
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaction()Returns the value of theactionrecord component.cdata()Returns the value of thecdatarecord component.Returns the value of thechallengeTsrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theerrorCodesrecord component.final inthashCode()Returns a hash code value for this object.hostname()Returns the value of thehostnamerecord component.static TurnstileAnswerReads siteverify's JSON.booleansuccess()Returns the value of thesuccessrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TurnstileAnswer
-
-
Method Details
-
of
Reads siteverify's JSON. Only a JSONtrueis success; fields of the wrong type, and achallenge_tsthat is not an ISO-8601 instant, count as absent.- Parameters:
json- the answer, as Spring read it- Returns:
- the answer
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
success
-
action
-
hostname
-
challengeTs
Returns the value of thechallengeTsrecord component.- Returns:
- the value of the
challengeTsrecord component
-
cdata
-
errorCodes
Returns the value of theerrorCodesrecord component.- Returns:
- the value of the
errorCodesrecord component
-