File tree Expand file tree Collapse file tree 8 files changed +20
-0
lines changed
android/guava/src/com/google/common/primitives
guava/src/com/google/common/primitives Expand file tree Collapse file tree 8 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -248,6 +248,8 @@ public static double max(double... array) {
248248 * unchanged. If {@code value} is less than {@code min}, {@code min} is returned, and if {@code
249249 * value} is greater than {@code max}, {@code max} is returned.
250250 *
251+ * <p><b>Java 21+ users:</b> Use {@code Math.clamp} instead.
252+ *
251253 * @param value the {@code double} value to constrain
252254 * @param min the lower bound (inclusive) of the range to constrain {@code value} to
253255 * @param max the upper bound (inclusive) of the range to constrain {@code value} to
Original file line number Diff line number Diff line change @@ -245,6 +245,8 @@ public static float max(float... array) {
245245 * unchanged. If {@code value} is less than {@code min}, {@code min} is returned, and if {@code
246246 * value} is greater than {@code max}, {@code max} is returned.
247247 *
248+ * <p><b>Java 21+ users:</b> Use {@code Math.clamp} instead.
249+ *
248250 * @param value the {@code float} value to constrain
249251 * @param min the lower bound (inclusive) of the range to constrain {@code value} to
250252 * @param max the upper bound (inclusive) of the range to constrain {@code value} to
Original file line number Diff line number Diff line change @@ -262,6 +262,9 @@ public static int max(int... array) {
262262 * unchanged. If {@code value} is less than {@code min}, {@code min} is returned, and if {@code
263263 * value} is greater than {@code max}, {@code max} is returned.
264264 *
265+ * <p><b>Java 21+ users:</b> Use {@code Math.clamp} instead. Note that that method is capable of
266+ * constraining a {@code long} input to an {@code int} range.
267+ *
265268 * @param value the {@code int} value to constrain
266269 * @param min the lower bound (inclusive) of the range to constrain {@code value} to
267270 * @param max the upper bound (inclusive) of the range to constrain {@code value} to
Original file line number Diff line number Diff line change @@ -229,6 +229,9 @@ public static long max(long... array) {
229229 * unchanged. If {@code value} is less than {@code min}, {@code min} is returned, and if {@code
230230 * value} is greater than {@code max}, {@code max} is returned.
231231 *
232+ * <p><b>Java 21+ users:</b> Use {@code Math.clamp} instead. Note that that method is capable of
233+ * constraining a {@code long} input to an {@code int} range.
234+ *
232235 * @param value the {@code long} value to constrain
233236 * @param min the lower bound (inclusive) of the range to constrain {@code value} to
234237 * @param max the upper bound (inclusive) of the range to constrain {@code value} to
Original file line number Diff line number Diff line change @@ -250,6 +250,8 @@ public static double max(double... array) {
250250 * unchanged. If {@code value} is less than {@code min}, {@code min} is returned, and if {@code
251251 * value} is greater than {@code max}, {@code max} is returned.
252252 *
253+ * <p><b>Java 21+ users:</b> Use {@code Math.clamp} instead.
254+ *
253255 * @param value the {@code double} value to constrain
254256 * @param min the lower bound (inclusive) of the range to constrain {@code value} to
255257 * @param max the upper bound (inclusive) of the range to constrain {@code value} to
Original file line number Diff line number Diff line change @@ -245,6 +245,8 @@ public static float max(float... array) {
245245 * unchanged. If {@code value} is less than {@code min}, {@code min} is returned, and if {@code
246246 * value} is greater than {@code max}, {@code max} is returned.
247247 *
248+ * <p><b>Java 21+ users:</b> Use {@code Math.clamp} instead.
249+ *
248250 * @param value the {@code float} value to constrain
249251 * @param min the lower bound (inclusive) of the range to constrain {@code value} to
250252 * @param max the upper bound (inclusive) of the range to constrain {@code value} to
Original file line number Diff line number Diff line change @@ -264,6 +264,9 @@ public static int max(int... array) {
264264 * unchanged. If {@code value} is less than {@code min}, {@code min} is returned, and if {@code
265265 * value} is greater than {@code max}, {@code max} is returned.
266266 *
267+ * <p><b>Java 21+ users:</b> Use {@code Math.clamp} instead. Note that that method is capable of
268+ * constraining a {@code long} input to an {@code int} range.
269+ *
267270 * @param value the {@code int} value to constrain
268271 * @param min the lower bound (inclusive) of the range to constrain {@code value} to
269272 * @param max the upper bound (inclusive) of the range to constrain {@code value} to
Original file line number Diff line number Diff line change @@ -231,6 +231,9 @@ public static long max(long... array) {
231231 * unchanged. If {@code value} is less than {@code min}, {@code min} is returned, and if {@code
232232 * value} is greater than {@code max}, {@code max} is returned.
233233 *
234+ * <p><b>Java 21+ users:</b> Use {@code Math.clamp} instead. Note that that method is capable of
235+ * constraining a {@code long} input to an {@code int} range.
236+ *
234237 * @param value the {@code long} value to constrain
235238 * @param min the lower bound (inclusive) of the range to constrain {@code value} to
236239 * @param max the upper bound (inclusive) of the range to constrain {@code value} to
You can’t perform that action at this time.
0 commit comments