@Test public void of() throws Exception { AccessTokenResponse response = AccessTokenResponse.of("token", "bearer", 3600); assertEquals("token", response.getAccessToken()); assertEquals("bearer", response.getTokenType()); assertEquals(3600, response.getExpiresIn()); assertFalse(response.getRefreshToken().isPresent()); assertFalse(response.getScope().isPresent()); }
public static AccessTokenResponse of(String accessToken, String tokenType, int expiresIn) { return new AutoValue_AccessTokenResponse(accessToken, tokenType, expiresIn, Optional.empty(), Optional.empty()); }
AccessTokenResponse { public static AccessTokenResponse of(String accessToken, String tokenType, int expiresIn) { return new AutoValue_AccessTokenResponse(accessToken, tokenType, expiresIn, Optional.empty(), Optional.empty()); } }
AccessTokenResponse { public static AccessTokenResponse of(String accessToken, String tokenType, int expiresIn) { return new AutoValue_AccessTokenResponse(accessToken, tokenType, expiresIn, Optional.empty(), Optional.empty()); }  }
AccessTokenResponse { public static AccessTokenResponse of(String accessToken, String tokenType, int expiresIn) { return new AutoValue_AccessTokenResponse(accessToken, tokenType, expiresIn, Optional.empty(), Optional.empty()); }  @JsonProperty("access_token") @ApiModelProperty(name = "access_token", value = "access token value", example = "2YotnFZFEjr1zCsicMWsdv") abstract String getAccessToken(); @JsonProperty("token_type") @ApiModelProperty(name = "token_type", value = "access token type", example = "bearer") abstract String getTokenType(); @JsonProperty("expires_in") @ApiModelProperty(name = "expires_in", value = "expiration time of token, in seconds", example = "86400") abstract int getExpiresIn(); @JsonProperty("refresh_token") @ApiModelProperty(name = "refresh_token", value = "refresh token value", example = "tGzv3JOkF0XG5Qx2TlKWIA") abstract Optional<String> getRefreshToken(); @JsonProperty("scope") @ApiModelProperty(name = "scope", value = "scope of the access token", example = "admin") abstract Optional<String> getScope(); static AccessTokenResponse of(String accessToken, String tokenType, int expiresIn); static AccessTokenResponse of(String accessToken, String tokenType, int expiresIn, String refreshToken, String scope); }
AccessTokenResponse { public static AccessTokenResponse of(String accessToken, String tokenType, int expiresIn) { return new AutoValue_AccessTokenResponse(accessToken, tokenType, expiresIn, Optional.empty(), Optional.empty()); }  @JsonProperty("access_token") @ApiModelProperty(name = "access_token", value = "access token value", example = "2YotnFZFEjr1zCsicMWsdv") abstract String getAccessToken(); @JsonProperty("token_type") @ApiModelProperty(name = "token_type", value = "access token type", example = "bearer") abstract String getTokenType(); @JsonProperty("expires_in") @ApiModelProperty(name = "expires_in", value = "expiration time of token, in seconds", example = "86400") abstract int getExpiresIn(); @JsonProperty("refresh_token") @ApiModelProperty(name = "refresh_token", value = "refresh token value", example = "tGzv3JOkF0XG5Qx2TlKWIA") abstract Optional<String> getRefreshToken(); @JsonProperty("scope") @ApiModelProperty(name = "scope", value = "scope of the access token", example = "admin") abstract Optional<String> getScope(); static AccessTokenResponse of(String accessToken, String tokenType, int expiresIn); static AccessTokenResponse of(String accessToken, String tokenType, int expiresIn, String refreshToken, String scope);  }