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.
Methods
equals(Object o)
public boolean equals(Object o)
Parameter | |
---|---|
Name | Description |
o |
Object |
Returns | |
---|---|
Type | Description |
boolean |
getMaxLength()
public long getMaxLength()
The maximum maxLength for any RangeSpec returned from #apply(long, RangeSpec)
Default: 0
-- no max length
See Also: #withMaxLength(long), RangeSpec#maxLength()
Returns | |
---|---|
Type | Description |
long |
hashCode()
public int hashCode()
Returns | |
---|---|
Type | Description |
int |
toString()
public String toString()
Returns | |
---|---|
Type | Description |
String |
withMaxLength(long maxLength)
public MaxLengthRangeSpecFunction withMaxLength(long maxLength)
Return an instance with the maxLength
set to the specified value.
Default: 0
-- no max length
See Also: RangeSpec#maxLength(), #getMaxLength()
Parameter | |
---|---|
Name | Description |
maxLength |
long The number of bytes a RangeSpecs maxLength should be limited to. Must
be > |
Returns | |
---|---|
Type | Description |
MaxLengthRangeSpecFunction |