Skip to content

Commit 146daf6

Browse files
kluevercopybara-github
authored andcommitted
Add @CheckReturnValue and @CanIgnoreReturnValue to Scheme APIs.
PiperOrigin-RevId: 460498188
1 parent 4dbd965 commit 146daf6

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

java/scheme/Scheme.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@
1818

1919
package scheme;
2020

21+
import com.google.errorprone.annotations.CanIgnoreReturnValue;
22+
import com.google.errorprone.annotations.CheckReturnValue;
2123
import palettes.CorePalette;
2224

2325
/** Represents a Material color scheme, a mapping of color roles to colors. */
26+
@CheckReturnValue
2427
public class Scheme {
2528
private int primary;
2629
private int onPrimary;
@@ -196,6 +199,7 @@ public void setPrimary(int primary) {
196199
this.primary = primary;
197200
}
198201

202+
@CanIgnoreReturnValue
199203
public Scheme withPrimary(int primary) {
200204
this.primary = primary;
201205
return this;
@@ -209,6 +213,7 @@ public void setOnPrimary(int onPrimary) {
209213
this.onPrimary = onPrimary;
210214
}
211215

216+
@CanIgnoreReturnValue
212217
public Scheme withOnPrimary(int onPrimary) {
213218
this.onPrimary = onPrimary;
214219
return this;
@@ -222,6 +227,7 @@ public void setPrimaryContainer(int primaryContainer) {
222227
this.primaryContainer = primaryContainer;
223228
}
224229

230+
@CanIgnoreReturnValue
225231
public Scheme withPrimaryContainer(int primaryContainer) {
226232
this.primaryContainer = primaryContainer;
227233
return this;
@@ -235,6 +241,7 @@ public void setOnPrimaryContainer(int onPrimaryContainer) {
235241
this.onPrimaryContainer = onPrimaryContainer;
236242
}
237243

244+
@CanIgnoreReturnValue
238245
public Scheme withOnPrimaryContainer(int onPrimaryContainer) {
239246
this.onPrimaryContainer = onPrimaryContainer;
240247
return this;
@@ -248,6 +255,7 @@ public void setSecondary(int secondary) {
248255
this.secondary = secondary;
249256
}
250257

258+
@CanIgnoreReturnValue
251259
public Scheme withSecondary(int secondary) {
252260
this.secondary = secondary;
253261
return this;
@@ -261,6 +269,7 @@ public void setOnSecondary(int onSecondary) {
261269
this.onSecondary = onSecondary;
262270
}
263271

272+
@CanIgnoreReturnValue
264273
public Scheme withOnSecondary(int onSecondary) {
265274
this.onSecondary = onSecondary;
266275
return this;
@@ -274,6 +283,7 @@ public void setSecondaryContainer(int secondaryContainer) {
274283
this.secondaryContainer = secondaryContainer;
275284
}
276285

286+
@CanIgnoreReturnValue
277287
public Scheme withSecondaryContainer(int secondaryContainer) {
278288
this.secondaryContainer = secondaryContainer;
279289
return this;
@@ -287,6 +297,7 @@ public void setOnSecondaryContainer(int onSecondaryContainer) {
287297
this.onSecondaryContainer = onSecondaryContainer;
288298
}
289299

300+
@CanIgnoreReturnValue
290301
public Scheme withOnSecondaryContainer(int onSecondaryContainer) {
291302
this.onSecondaryContainer = onSecondaryContainer;
292303
return this;
@@ -300,6 +311,7 @@ public void setTertiary(int tertiary) {
300311
this.tertiary = tertiary;
301312
}
302313

314+
@CanIgnoreReturnValue
303315
public Scheme withTertiary(int tertiary) {
304316
this.tertiary = tertiary;
305317
return this;
@@ -313,6 +325,7 @@ public void setOnTertiary(int onTertiary) {
313325
this.onTertiary = onTertiary;
314326
}
315327

328+
@CanIgnoreReturnValue
316329
public Scheme withOnTertiary(int onTertiary) {
317330
this.onTertiary = onTertiary;
318331
return this;
@@ -326,6 +339,7 @@ public void setTertiaryContainer(int tertiaryContainer) {
326339
this.tertiaryContainer = tertiaryContainer;
327340
}
328341

342+
@CanIgnoreReturnValue
329343
public Scheme withTertiaryContainer(int tertiaryContainer) {
330344
this.tertiaryContainer = tertiaryContainer;
331345
return this;
@@ -339,6 +353,7 @@ public void setOnTertiaryContainer(int onTertiaryContainer) {
339353
this.onTertiaryContainer = onTertiaryContainer;
340354
}
341355

356+
@CanIgnoreReturnValue
342357
public Scheme withOnTertiaryContainer(int onTertiaryContainer) {
343358
this.onTertiaryContainer = onTertiaryContainer;
344359
return this;
@@ -352,6 +367,7 @@ public void setError(int error) {
352367
this.error = error;
353368
}
354369

370+
@CanIgnoreReturnValue
355371
public Scheme withError(int error) {
356372
this.error = error;
357373
return this;
@@ -365,6 +381,7 @@ public void setOnError(int onError) {
365381
this.onError = onError;
366382
}
367383

384+
@CanIgnoreReturnValue
368385
public Scheme withOnError(int onError) {
369386
this.onError = onError;
370387
return this;
@@ -378,6 +395,7 @@ public void setErrorContainer(int errorContainer) {
378395
this.errorContainer = errorContainer;
379396
}
380397

398+
@CanIgnoreReturnValue
381399
public Scheme withErrorContainer(int errorContainer) {
382400
this.errorContainer = errorContainer;
383401
return this;
@@ -391,6 +409,7 @@ public void setOnErrorContainer(int onErrorContainer) {
391409
this.onErrorContainer = onErrorContainer;
392410
}
393411

412+
@CanIgnoreReturnValue
394413
public Scheme withOnErrorContainer(int onErrorContainer) {
395414
this.onErrorContainer = onErrorContainer;
396415
return this;
@@ -404,6 +423,7 @@ public void setBackground(int background) {
404423
this.background = background;
405424
}
406425

426+
@CanIgnoreReturnValue
407427
public Scheme withBackground(int background) {
408428
this.background = background;
409429
return this;
@@ -417,6 +437,7 @@ public void setOnBackground(int onBackground) {
417437
this.onBackground = onBackground;
418438
}
419439

440+
@CanIgnoreReturnValue
420441
public Scheme withOnBackground(int onBackground) {
421442
this.onBackground = onBackground;
422443
return this;
@@ -430,6 +451,7 @@ public void setSurface(int surface) {
430451
this.surface = surface;
431452
}
432453

454+
@CanIgnoreReturnValue
433455
public Scheme withSurface(int surface) {
434456
this.surface = surface;
435457
return this;
@@ -443,6 +465,7 @@ public void setOnSurface(int onSurface) {
443465
this.onSurface = onSurface;
444466
}
445467

468+
@CanIgnoreReturnValue
446469
public Scheme withOnSurface(int onSurface) {
447470
this.onSurface = onSurface;
448471
return this;
@@ -456,6 +479,7 @@ public void setSurfaceVariant(int surfaceVariant) {
456479
this.surfaceVariant = surfaceVariant;
457480
}
458481

482+
@CanIgnoreReturnValue
459483
public Scheme withSurfaceVariant(int surfaceVariant) {
460484
this.surfaceVariant = surfaceVariant;
461485
return this;
@@ -469,6 +493,7 @@ public void setOnSurfaceVariant(int onSurfaceVariant) {
469493
this.onSurfaceVariant = onSurfaceVariant;
470494
}
471495

496+
@CanIgnoreReturnValue
472497
public Scheme withOnSurfaceVariant(int onSurfaceVariant) {
473498
this.onSurfaceVariant = onSurfaceVariant;
474499
return this;
@@ -482,6 +507,7 @@ public void setOutline(int outline) {
482507
this.outline = outline;
483508
}
484509

510+
@CanIgnoreReturnValue
485511
public Scheme withOutline(int outline) {
486512
this.outline = outline;
487513
return this;
@@ -495,6 +521,7 @@ public void setShadow(int shadow) {
495521
this.shadow = shadow;
496522
}
497523

524+
@CanIgnoreReturnValue
498525
public Scheme withShadow(int shadow) {
499526
this.shadow = shadow;
500527
return this;
@@ -508,6 +535,7 @@ public void setInverseSurface(int inverseSurface) {
508535
this.inverseSurface = inverseSurface;
509536
}
510537

538+
@CanIgnoreReturnValue
511539
public Scheme withInverseSurface(int inverseSurface) {
512540
this.inverseSurface = inverseSurface;
513541
return this;
@@ -521,6 +549,7 @@ public void setInverseOnSurface(int inverseOnSurface) {
521549
this.inverseOnSurface = inverseOnSurface;
522550
}
523551

552+
@CanIgnoreReturnValue
524553
public Scheme withInverseOnSurface(int inverseOnSurface) {
525554
this.inverseOnSurface = inverseOnSurface;
526555
return this;
@@ -534,6 +563,7 @@ public void setInversePrimary(int inversePrimary) {
534563
this.inversePrimary = inversePrimary;
535564
}
536565

566+
@CanIgnoreReturnValue
537567
public Scheme withInversePrimary(int inversePrimary) {
538568
this.inversePrimary = inversePrimary;
539569
return this;

0 commit comments

Comments
 (0)