/** * @deprecated Use {@link #projectId} and/or {@link #host}/{@link #localHost} instead. * * Sets the project endpoint used to access Cloud Datastore. Prefer using {@link #projectId} * and/or {@link #host}/{@link #localHost} when possible. */ @Deprecated public Builder projectEndpoint(String projectEndpoint) { checkArgument(projectId == null, PROJECT_ENDPOINT_AND_PROJECT_ID_ERROR); checkArgument(localHost == null && host == null, PROJECT_ENDPOINT_AND_HOST_ERROR); if (!includesScheme(projectEndpoint)) { throw new IllegalArgumentException(String.format( "Project endpoint \"%s\" must include scheme.", projectEndpoint)); } this.projectEndpoint = projectEndpoint; return this; }
/** * Sets the host used to access Cloud Datastore. To connect to the Cloud Datastore Emulator, * use {@link #localHost} instead. */ public Builder host(String host) { checkArgument(projectEndpoint == null && localHost == null, PROJECT_ENDPOINT_AND_HOST_ERROR); if (includesScheme(host)) { throw new IllegalArgumentException( String.format("Host \"%s\" must not include scheme.", host)); } this.host = host; return this; }
/** * @deprecated Use {@link #projectId} and/or {@link #host}/{@link #localHost} instead. * * Sets the project endpoint used to access Cloud Datastore. Prefer using {@link #projectId} * and/or {@link #host}/{@link #localHost} when possible. */ @Deprecated public Builder projectEndpoint(String projectEndpoint) { checkArgument(projectId == null, PROJECT_ENDPOINT_AND_PROJECT_ID_ERROR); checkArgument(localHost == null && host == null, PROJECT_ENDPOINT_AND_HOST_ERROR); if (!includesScheme(projectEndpoint)) { throw new IllegalArgumentException(String.format( "Project endpoint \"%s\" must include scheme.", projectEndpoint)); } this.projectEndpoint = projectEndpoint; return this; }
/** * Configures the client to access Cloud Datastore on a local host (typically a Cloud Datastore * Emulator instance). Call this method also configures the client not to attach credentials * to requests. */ public Builder localHost(String localHost) { checkArgument(projectEndpoint == null && host == null, PROJECT_ENDPOINT_AND_HOST_ERROR); if (includesScheme(localHost)) { throw new IllegalArgumentException( String.format("Local host \"%s\" must not include scheme.", localHost)); } this.localHost = localHost; return this; }
/** * Configures the client to access Cloud Datastore on a local host (typically a Cloud Datastore * Emulator instance). Call this method also configures the client not to attach credentials * to requests. */ public Builder localHost(String localHost) { checkArgument(projectEndpoint == null && host == null, PROJECT_ENDPOINT_AND_HOST_ERROR); if (includesScheme(localHost)) { throw new IllegalArgumentException( String.format("Local host \"%s\" must not include scheme.", localHost)); } this.localHost = localHost; return this; }
/** * Sets the host used to access Cloud Datastore. To connect to the Cloud Datastore Emulator, * use {@link #localHost} instead. */ public Builder host(String host) { checkArgument(projectEndpoint == null && localHost == null, PROJECT_ENDPOINT_AND_HOST_ERROR); if (includesScheme(host)) { throw new IllegalArgumentException( String.format("Host \"%s\" must not include scheme.", host)); } this.host = host; return this; }