Package com.google.cloud.storage
Class RangeSpecFunction
java.lang.Object
com.google.cloud.storage.RangeSpecFunction
- Direct Known Subclasses:
LinearExponentialRangeSpecFunction,MaxLengthRangeSpecFunction
A specialized BiFunction to produce a
RangeSpec given an offset and a possible previous
RangeSpec.- Since:
- 2.51.0 This new api is in preview and is subject to breaking changes.
-
Method Summary
Modifier and TypeMethodDescriptionandThen(RangeSpecFunction then) Returns a composed function that first applies this function to its input, and then applies thethenfunction to the result.Get the default instance ofLinearExponentialRangeSpecFunction.static MaxLengthRangeSpecFunctionmaxLength(long maxLength) Produce a newMaxLengthRangeSpecFunctionwhere the maximum possible length of any returnedRangeSpecis set to the lesser ofprev.maxLengthandthis.maxLength.
-
Method Details
-
andThen
Returns a composed function that first applies this function to its input, and then applies thethenfunction to the result.Both functions will be called with the same
offset.The returned instance is equivalent to the following:
then.apply(offset, this.apply(offset, prev))- Since:
- 2.51.0 This new api is in preview and is subject to breaking changes.
-
linearExponential
Get the default instance ofLinearExponentialRangeSpecFunction.- Since:
- 2.51.0 This new api is in preview and is subject to breaking changes.
-
maxLength
Produce a newMaxLengthRangeSpecFunctionwhere the maximum possible length of any returnedRangeSpecis set to the lesser ofprev.maxLengthandthis.maxLength.- Since:
- 2.51.0 This new api is in preview and is subject to breaking changes.
-