1919import static com .google .common .base .Preconditions .checkNotNull ;
2020
2121import com .google .cloud .Policy ;
22-
2322import java .io .IOException ;
2423import java .io .ObjectInputStream ;
2524import java .util .List ;
@@ -41,9 +40,7 @@ public class Project extends ProjectInfo {
4140 private final ResourceManagerOptions options ;
4241 private transient ResourceManager resourceManager ;
4342
44- /**
45- * Builder for {@code Project}.
46- */
43+ /** Builder for {@code Project}. */
4744 public static class Builder extends ProjectInfo .Builder {
4845 private final ResourceManager resourceManager ;
4946 private final ProjectInfo .BuilderImpl infoBuilder ;
@@ -53,14 +50,12 @@ public static class Builder extends ProjectInfo.Builder {
5350 this .infoBuilder = new ProjectInfo .BuilderImpl (project );
5451 }
5552
56-
5753 @ Override
5854 public Builder setName (String name ) {
5955 infoBuilder .setName (name );
6056 return this ;
6157 }
6258
63-
6459 @ Override
6560 public Builder setProjectId (String projectId ) {
6661 infoBuilder .setProjectId (projectId );
@@ -85,7 +80,6 @@ public Builder clearLabels() {
8580 return this ;
8681 }
8782
88-
8983 @ Override
9084 public Builder setLabels (Map <String , String > labels ) {
9185 infoBuilder .setLabels (labels );
@@ -128,17 +122,13 @@ public Project build() {
128122 this .options = resourceManager .getOptions ();
129123 }
130124
131-
132- /**
133- * Returns the {@link ResourceManager} service object associated with this Project.
134- */
125+ /** Returns the {@link ResourceManager} service object associated with this Project. */
135126 public ResourceManager getResourceManager () {
136127 return resourceManager ;
137128 }
138129
139130 /**
140- * Fetches the project's latest information. Returns {@code null} if the project does not
141- * exist.
131+ * Fetches the project's latest information. Returns {@code null} if the project does not exist.
142132 *
143133 * @return Project containing the project's updated metadata or {@code null} if not found
144134 * @throws ResourceManagerException upon failure
@@ -151,18 +141,20 @@ public Project reload() {
151141 * Marks the project identified by the specified project ID for deletion.
152142 *
153143 * <p>This method will only affect the project if the following criteria are met:
144+ *
154145 * <ul>
155- * <li>The project does not have a billing account associated with it.
156- * <li>The project has a lifecycle state of {@link ProjectInfo.State#ACTIVE}.
146+ * <li>The project does not have a billing account associated with it.
147+ * <li>The project has a lifecycle state of {@link ProjectInfo.State#ACTIVE}.
157148 * </ul>
149+ *
158150 * This method changes the project's lifecycle state from {@link ProjectInfo.State#ACTIVE} to
159151 * {@link ProjectInfo.State#DELETE_REQUESTED}. The deletion starts at an unspecified time, at
160152 * which point the lifecycle state changes to {@link ProjectInfo.State#DELETE_IN_PROGRESS}. Until
161153 * the deletion completes, you can check the lifecycle state checked by retrieving the project
162- * with {@link ResourceManager#get}, and the project remains visible to
163- * {@link ResourceManager#list}. However, you cannot update the project. After the deletion
164- * completes, the project is not retrievable by the {@link ResourceManager#get} and
165- * {@link ResourceManager#list} methods. The caller must have modify permissions for this project.
154+ * with {@link ResourceManager#get}, and the project remains visible to {@link
155+ * ResourceManager#list}. However, you cannot update the project. After the deletion completes,
156+ * the project is not retrievable by the {@link ResourceManager#get} and {@link
157+ * ResourceManager#list} methods. The caller must have modify permissions for this project.
166158 *
167159 * @throws ResourceManagerException upon failure
168160 * @see <a href=
@@ -176,10 +168,10 @@ public void delete() {
176168 /**
177169 * Restores the project identified by the specified project ID.
178170 *
179- * <p>You can only use this method for a project that has a lifecycle state of
180- * {@link ProjectInfo.State#DELETE_REQUESTED}. After deletion starts, as indicated by a lifecycle
181- * state of {@link ProjectInfo.State#DELETE_IN_PROGRESS}, the project cannot be restored. The
182- * caller must have modify permissions for this project.
171+ * <p>You can only use this method for a project that has a lifecycle state of {@link
172+ * ProjectInfo.State#DELETE_REQUESTED}. After deletion starts, as indicated by a lifecycle state
173+ * of {@link ProjectInfo.State#DELETE_IN_PROGRESS}, the project cannot be restored. The caller
174+ * must have modify permissions for this project.
183175 *
184176 * @throws ResourceManagerException upon failure (including when the project can't be restored)
185177 * @see <a href=
@@ -239,7 +231,7 @@ public Policy replacePolicy(Policy newPolicy) {
239231 * if you're using Google Cloud Platform directly to manage permissions. This method is intended
240232 * for integration with your proprietary software, such as a customized graphical user interface.
241233 * For example, the Cloud Platform Console tests IAM permissions internally to determine which UI
242- * should be available to the logged-in user. Each service that supports IAM lists the possible
234+ * should be available to the logged-in user. Each service that supports IAM lists the possible
243235 * permissions; see the <i>Supported Cloud Platform services</i> page below for links to these
244236 * lists.
245237 *
@@ -249,9 +241,8 @@ public Policy replacePolicy(Policy newPolicy) {
249241 * @see <a href=
250242 * "https://cloud.google.com/resource-manager/reference/rest/v1beta1/projects/testIamPermissions">
251243 * Resource Manager testIamPermissions</a>
252- * @see <a href=
253- * "https://cloud.google.com/iam/#supported_cloud_platform_services">Supported Cloud Platform
254- * Services</a>
244+ * @see <a href= "https://cloud.google.com/iam/#supported_cloud_platform_services">Supported Cloud
245+ * Platform Services</a>
255246 */
256247 List <Boolean > testPermissions (List <String > permissions ) {
257248 return resourceManager .testPermissions (getProjectId (), permissions );
@@ -271,8 +262,7 @@ public final boolean equals(Object obj) {
271262 return false ;
272263 }
273264 Project other = (Project ) obj ;
274- return Objects .equals (toPb (), other .toPb ())
275- && Objects .equals (options , other .options );
265+ return Objects .equals (toPb (), other .toPb ()) && Objects .equals (options , other .options );
276266 }
277267
278268 @ Override
@@ -285,7 +275,8 @@ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundE
285275 this .resourceManager = options .getService ();
286276 }
287277
288- static Project fromPb (ResourceManager resourceManager ,
278+ static Project fromPb (
279+ ResourceManager resourceManager ,
289280 com .google .api .services .cloudresourcemanager .model .Project answer ) {
290281 ProjectInfo info = ProjectInfo .fromPb (answer );
291282 return new Project (resourceManager , new ProjectInfo .BuilderImpl (info ));
0 commit comments