Class RangeSpecFunction

java.lang.Object
com.google.cloud.storage.RangeSpecFunction
Direct Known Subclasses:
LinearExponentialRangeSpecFunction, MaxLengthRangeSpecFunction

@BetaApi @Immutable @InternalExtensionOnly public abstract class RangeSpecFunction extends Object
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 Details

    • andThen

      @BetaApi public RangeSpecFunction andThen(RangeSpecFunction then)
      Returns a composed function that first applies this function to its input, and then applies the then function 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

      @BetaApi public static LinearExponentialRangeSpecFunction linearExponential()
      Get the default instance of LinearExponentialRangeSpecFunction.
      Since:
      2.51.0 This new api is in preview and is subject to breaking changes.
    • maxLength

      @BetaApi public static MaxLengthRangeSpecFunction maxLength(long maxLength)
      Produce a new MaxLengthRangeSpecFunction where the maximum possible length of any returned RangeSpec is set to the lesser of prev.maxLength and this.maxLength.
      Since:
      2.51.0 This new api is in preview and is subject to breaking changes.