You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2019/09/11 14:21:29 UTC
[commons-lang] branch master updated: Javadoc.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
The following commit(s) were added to refs/heads/master by this push:
new a3aa116 Javadoc.
a3aa116 is described below
commit a3aa116d35f7cd7f412a51aca83d0d870200e703
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Wed Sep 11 10:21:23 2019 -0400
Javadoc.
---
src/main/java/org/apache/commons/lang3/Range.java | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/commons/lang3/Range.java b/src/main/java/org/apache/commons/lang3/Range.java
index 449be0c..e578701 100644
--- a/src/main/java/org/apache/commons/lang3/Range.java
+++ b/src/main/java/org/apache/commons/lang3/Range.java
@@ -457,7 +457,18 @@ public final class Range<T> implements Serializable {
* Fits the given element into this range by returning the given element or, if out of bounds, the range minimum if
* below, or the range maximum if above.
* </p>
- *
+ * <pre>
+ * Range<Integer> range = Range.between(16, 64);
+ * range.fit(-9) --> 16
+ * range.fit(0) --> 16
+ * range.fit(15) --> 16
+ * range.fit(16) --> 16
+ * range.fit(17) --> 17
+ * ...
+ * range.fit(63) --> 63
+ * range.fit(64) --> 64
+ * range.fit(99) --> 64
+ * </pre>
* @param element the element to check for, not null
* @return the minimum, the element, or the maximum depending on the element's location relative to the range
* @since 3.10