Class HttpInteraction
java.lang.Object
com.easypost.easyvcr.requestelements.HttpElement
com.easypost.easyvcr.requestelements.HttpInteraction
Represents an HTTP request-response pair tracked by EasyVCR.
-
Constructor Summary
ConstructorsConstructorDescriptionHttpInteraction(Request request, Response response, long duration)Constructs a new HTTPInteraction object. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the duration of the request in milliseconds.longReturns the timestamp of when the interaction was recorded.Returns the HTTP request.Returns the HTTP response.voidsetDuration(int duration)Sets the duration of the request in milliseconds.voidsetRecordedAt(long recordedAt)Set the timestamp of when the interaction was recorded.voidsetRequest(Request request)Sets the HTTP request.voidsetResponse(Response response)Sets the HTTP response.Methods inherited from class com.easypost.easyvcr.requestelements.HttpElement
toJson
-
Constructor Details
-
HttpInteraction
Constructs a new HTTPInteraction object.- Parameters:
request- The HTTP request.response- The HTTP response.duration- The duration of the request in milliseconds.
-
-
Method Details
-
getRecordedAt
public long getRecordedAt()Returns the timestamp of when the interaction was recorded.- Returns:
- The timestamp of when the interaction was recorded.
-
setRecordedAt
public void setRecordedAt(long recordedAt)Set the timestamp of when the interaction was recorded.- Parameters:
recordedAt- The timestamp of when the interaction was recorded.
-
getRequest
Returns the HTTP request.- Returns:
- The HTTP request.
-
setRequest
Sets the HTTP request.- Parameters:
request- The HTTP request.
-
getResponse
Returns the HTTP response.- Returns:
- The HTTP response.
-
setResponse
Sets the HTTP response.- Parameters:
response- The HTTP response.
-
getDuration
public long getDuration()Returns the duration of the request in milliseconds.- Returns:
- The duration of the request in milliseconds.
-
setDuration
public void setDuration(int duration)Sets the duration of the request in milliseconds.- Parameters:
duration- The duration of the request in milliseconds.
-