Package com.amalgamasimulation.utils
Record Class ConnectivityDiagnosis
java.lang.Object
java.lang.Record
com.amalgamasimulation.utils.ConnectivityDiagnosis
- Record Components:
status- check outcomehttpStatus- non-success HTTP status, or nullcause- connection failure, or null
public record ConnectivityDiagnosis(ConnectivityDiagnosis.Status status, Integer httpStatus, Throwable cause)
extends Record
Detailed result of a server connectivity check.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionConnectivityDiagnosis(ConnectivityDiagnosis.Status status, Integer httpStatus, Throwable cause) Creates an instance of aConnectivityDiagnosisrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncause()Returns the value of thecauserecord component.static ConnectivityDiagnosisconnectionError(Throwable cause) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static ConnectivityDiagnosishttpError(int statusCode) Returns the value of thehttpStatusrecord component.static ConnectivityDiagnosisbooleanisOk()static ConnectivityDiagnosisok()status()Returns the value of thestatusrecord component.final StringtoString()Returns a string representation of this record class.static ConnectivityDiagnosis
-
Constructor Details
-
ConnectivityDiagnosis
public ConnectivityDiagnosis(ConnectivityDiagnosis.Status status, Integer httpStatus, Throwable cause) Creates an instance of aConnectivityDiagnosisrecord class.- Parameters:
status- the value for thestatusrecord componenthttpStatus- the value for thehttpStatusrecord componentcause- the value for thecauserecord component
-
-
Method Details
-
isOk
public boolean isOk() -
ok
-
httpError
-
connectionError
-
invalidResponse
-
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
-
httpStatus
Returns the value of thehttpStatusrecord component.- Returns:
- the value of the
httpStatusrecord component
-
cause
Returns the value of thecauserecord component.- Returns:
- the value of the
causerecord component
-