Class MaxLengthRangeSpecFunction

java.lang.Object
com.google.cloud.storage.RangeSpecFunction
com.google.cloud.storage.MaxLengthRangeSpecFunction

@BetaApi @Immutable public final class MaxLengthRangeSpecFunction extends RangeSpecFunction
Produce a new RangeSpec relative to the provided offset and prev, where the RangeSpec will have a maxLength set to the lesser of prev.maxLength and this.maxLength.

Instances of this class are immutable and thread safe.

Since:
2.51.0 This new api is in preview and is subject to breaking changes.
  • Method Details

    • getMaxLength

      public long getMaxLength()
      The maximum maxLength for any RangeSpec returned from apply(long, RangeSpec)

      Default: 0 -- no max length

      Since:
      2.51.0 This new api is in preview and is subject to breaking changes.
      See Also:
    • withMaxLength

      public MaxLengthRangeSpecFunction withMaxLength(long maxLength)
      Return an instance with the maxLength set to the specified value.

      Default: 0 -- no max length

      Parameters:
      maxLength - The number of bytes a RangeSpecs maxLength should be limited to. Must be > 0.
      Since:
      2.51.0 This new api is in preview and is subject to breaking changes.
      See Also:
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object