3232import com .google .api .core .BetaApi ;
3333import com .google .api .core .InternalExtensionOnly ;
3434import com .google .api .gax .rpc .StatusCode ;
35+ import com .google .api .gax .rpc .StatusCode .Code ;
3536import com .google .common .base .Strings ;
3637import java .util .Objects ;
3738
@@ -46,22 +47,22 @@ public class HttpJsonStatusCode implements StatusCode {
4647 static final String UNKNOWN = "UNKNOWN" ;
4748
4849 private final int httpStatus ;
49- private final StatusCode . Code statusCode ;
50+ private final Code statusCode ;
5051
5152 /** Creates a new instance with the given status code. */
5253 public static HttpJsonStatusCode of (int httpStatus , String errorMessage ) {
5354 return new HttpJsonStatusCode (httpStatus , httpStatusToStatusCode (httpStatus , errorMessage ));
5455 }
5556
56- public static HttpJsonStatusCode of (StatusCode . Code statusCode ) {
57+ public static HttpJsonStatusCode of (Code statusCode ) {
5758 return new HttpJsonStatusCode (statusCode .getHttpStatusCode (), statusCode );
5859 }
5960
6061 public static HttpJsonStatusCode of (com .google .rpc .Code rpcCode ) {
61- return new HttpJsonStatusCode ( rpcCode . getNumber (), rpcCodeToStatusCode (rpcCode ));
62+ return HttpJsonStatusCode . of ( rpcCodeToStatusCode (rpcCode ));
6263 }
6364
64- static StatusCode . Code rpcCodeToStatusCode (com .google .rpc .Code rpcCode ) {
65+ static Code rpcCodeToStatusCode (com .google .rpc .Code rpcCode ) {
6566 switch (rpcCode ) {
6667 case OK :
6768 return Code .OK ;
@@ -102,7 +103,7 @@ static StatusCode.Code rpcCodeToStatusCode(com.google.rpc.Code rpcCode) {
102103 }
103104 }
104105
105- static StatusCode . Code httpStatusToStatusCode (int httpStatus , String errorMessage ) {
106+ static Code httpStatusToStatusCode (int httpStatus , String errorMessage ) {
106107 String causeMessage = Strings .nullToEmpty (errorMessage ).toUpperCase ();
107108 switch (httpStatus ) {
108109 case 200 :
@@ -155,7 +156,7 @@ static StatusCode.Code httpStatusToStatusCode(int httpStatus, String errorMessag
155156 }
156157
157158 @ Override
158- public StatusCode . Code getCode () {
159+ public Code getCode () {
159160 return statusCode ;
160161 }
161162
@@ -165,8 +166,8 @@ public Integer getTransportCode() {
165166 return httpStatus ;
166167 }
167168
168- private HttpJsonStatusCode (int code , StatusCode . Code statusCode ) {
169- this .httpStatus = code ;
169+ private HttpJsonStatusCode (int httpStatus , Code statusCode ) {
170+ this .httpStatus = httpStatus ;
170171 this .statusCode = statusCode ;
171172 }
172173
0 commit comments