Package markets.alpaca.client.ws
Record Class AlpacaStreamAuthResult
java.lang.Object
java.lang.Record
markets.alpaca.client.ws.AlpacaStreamAuthResult
public record AlpacaStreamAuthResult(AlpacaStreamAuthResult.Status status, Integer code, String message)
extends Record
Result of a stream's first authentication attempt.
Use isAuthenticated() for simple success checks, or inspect status(), code(), and message() when operational diagnostics need the server response or close
reason.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumOutcome categories for stream authentication. -
Constructor Summary
ConstructorsConstructorDescriptionAlpacaStreamAuthResult(AlpacaStreamAuthResult.Status status, Integer code, String message) Creates an instance of aAlpacaStreamAuthResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic AlpacaStreamAuthResultCreates a successful authentication result.static AlpacaStreamAuthResultCreates a result for streams closed before authentication completed.code()Returns the value of thecoderecord component.final booleanIndicates whether some other object is "equal to" this one.static AlpacaStreamAuthResultCreates a result for non-server-rejection failures before authentication completed.final inthashCode()Returns a hash code value for this object.static AlpacaStreamAuthResultCreates a result for waiting callers that were interrupted.booleanmessage()Returns the value of themessagerecord component.static AlpacaStreamAuthResultserverRejected(Integer code, String message) Creates a result for credentials or auth requests rejected by the server.status()Returns the value of thestatusrecord component.static AlpacaStreamAuthResultCreates a result for waiting callers whose timeout elapsed.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
AlpacaStreamAuthResult
Creates an instance of aAlpacaStreamAuthResultrecord class.- Parameters:
status- the value for thestatusrecord componentcode- the value for thecoderecord componentmessage- the value for themessagerecord component
-
-
Method Details
-
isAuthenticated
public boolean isAuthenticated() -
authenticated
Creates a successful authentication result. -
serverRejected
Creates a result for credentials or auth requests rejected by the server. -
closed
Creates a result for streams closed before authentication completed. -
timeout
Creates a result for waiting callers whose timeout elapsed. -
interrupted
Creates a result for waiting callers that were interrupted. -
failed
Creates a result for non-server-rejection failures before authentication completed. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. All components in this record class are compared withObjects::equals(Object,Object). -
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
code
Returns the value of thecoderecord component.- Returns:
- the value of the
coderecord component
-
message
Returns the value of themessagerecord component.- Returns:
- the value of the
messagerecord component
-