Record Class BitBucketPPRApiResponse
java.lang.Object
java.lang.Record
io.jenkins.plugins.bitbucketpushandpullrequest.client.api.BitBucketPPRApiResponse
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
public record BitBucketPPRApiResponse(int statusCode, String body)
extends Record
Outcome of a Bitbucket API call, detached from the transport that produced it. The sender fully
owns the lifecycle of its HTTP client and response: by the time this value is returned, every
underlying resource has been consumed and released, so callers can hold it freely.
-
Constructor Summary
ConstructorsConstructorDescriptionBitBucketPPRApiResponse(int statusCode, String body) Creates an instance of aBitBucketPPRApiResponserecord class. -
Method Summary
Modifier and TypeMethodDescriptionbody()Returns the value of thebodyrecord component.final booleanIndicates whether some other object is "equal to" this one.static BitBucketPPRApiResponsefrom(com.github.scribejava.core.model.Response response) Materializes a scribejava response with the same body cap as the Apache path.static BitBucketPPRApiResponsefrom(org.apache.http.HttpResponse response) Materializes an Apache HttpClient response.final inthashCode()Returns a hash code value for this object.intReturns the value of thestatusCoderecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
BitBucketPPRApiResponse
Creates an instance of aBitBucketPPRApiResponserecord class.- Parameters:
statusCode- the value for thestatusCoderecord componentbody- the value for thebodyrecord component
-
-
Method Details
-
from
public static BitBucketPPRApiResponse from(org.apache.http.HttpResponse response) throws IOException Materializes an Apache HttpClient response. Used as theResponseHandlerofCloseableHttpClient#execute(HttpUriRequest, ResponseHandler), the execution form that releases the connection before returning.- Throws:
IOException
-
from
public static BitBucketPPRApiResponse from(com.github.scribejava.core.model.Response response) throws IOException Materializes a scribejava response with the same body cap as the Apache path. The stream is decompressed when the reply declaresContent-Encoding: gzip, mirroring whatResponse#getBody()would do, but reading at most the cap.- Throws:
IOException
-
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. -
statusCode
public int statusCode()Returns the value of thestatusCoderecord component.- Returns:
- the value of the
statusCoderecord component
-
body
Returns the value of thebodyrecord component.- Returns:
- the value of the
bodyrecord component
-