public class ClientId extends Object
Corresponds to the information in the json file downloadable for a Client ID.
| Modifier and Type | Class and Description |
|---|---|
static class |
ClientId.Builder |
| Constructor and Description |
|---|
ClientId(String clientId,
String clientSecret)
Deprecated.
Use
of(String, String) instead. This constructor will either be deleted
or made private in a later version. |
| Modifier and Type | Method and Description |
|---|---|
static ClientId |
fromJson(Map<String,Object> json)
Constructs a Client ID from JSON from a downloaded file.
|
static ClientId |
fromResource(Class<?> relativeClass,
String resourceName)
Constructs a Client ID from JSON file stored as a resource.
|
static ClientId |
fromStream(InputStream stream)
Constructs a Client ID from JSON file stream.
|
String |
getClientId()
Returns the text identifier of the Client ID.
|
String |
getClientSecret()
Returns the secret associated with the Client ID.
|
static ClientId.Builder |
newBuilder() |
static ClientId |
of(String clientId,
String clientSecret)
Constructs a client ID from an explicit ID and secret.
|
ClientId.Builder |
toBuilder() |
@Deprecated public ClientId(String clientId, String clientSecret)
of(String, String) instead. This constructor will either be deleted
or made private in a later version.Note: Direct use of this constructor in application code is not recommended to avoid having secrets or values that need to be updated in source code.
clientId - Text identifier of the Client ID.clientSecret - Secret to associated with the Client ID.public static ClientId of(String clientId, String clientSecret)
Note: Direct use of this factory method in application code is not recommended to avoid having secrets or values that need to be updated in source code.
clientId - Text identifier of the Client ID.clientSecret - Secret to associated with the Client ID.public static ClientId fromJson(Map<String,Object> json) throws IOException
json - The JSON from the downloaded file.IOException - The JSON could not be parsed.public static ClientId fromResource(Class<?> relativeClass, String resourceName) throws IOException
relativeClass - A class in the same namespace as the resource.resourceName - The name of the resourceIOException - The JSON could not be loaded or parsed.public static ClientId fromStream(InputStream stream) throws IOException
stream - Stream of the downloaded JSON file.IOException - The JSON could not be read or parsed.public final String getClientId()
public final String getClientSecret()
public static ClientId.Builder newBuilder()
public ClientId.Builder toBuilder()
Copyright © 2017 Google. All rights reserved.