Interface BuildableBytesFunction<T>
- All Superinterfaces:
BuildableFunction<T,
,byte[]> Function<T,
byte[]>
byte[]
result, and
supports building derived functional types.-
Method Summary
Modifier and TypeMethodDescriptiondefault BuildableBytesFunction<T>
append
(byte[] data) Returns a function that appends the provided array.default BuildableBytesFunction<T>
head
(int length) Returns a function that returns the head of the extracted byte array.default BuildableBytesFunction<T>
insert
(int at, byte[] data) Returns a function that inserts the provided array at a specific offset.default BuildableToIntFunction<T>
length()
Returns a function that returns the length of the extracted byte array.default BuildableBytesFunction<T>
range
(int start, int end) Returns a function that returns a range of the extracted byte array.default BuildableBytesFunction<T>
remove
(int start, int end) Returns a function that removes bytes in a given range.default BuildableBytesFunction<T>
tail
(int length) Returns a function that returns the tail of the extracted byte array.default BuildableBytesFunction<T>
truncate
(int count) Returns a function that removescount
bytes from the end of the array.Methods inherited from interface com.terracottatech.store.function.BuildableFunction
in, in, is
-
Method Details
-
length
Returns a function that returns the length of the extracted byte array.- Returns:
- a byte array length function
-
range
Returns a function that returns a range of the extracted byte array.If the requested range is provably out-of-bounds or otherwise invalid then an
IllegalArgumentException
will be thrown by this method. If the requested range is found to be out-of-bounds at evaluation time then the returned function will throwIndexOutOfBoundsException
.- Parameters:
start
- inclusive range startend
- exclusive range end- Returns:
- a range reading function
- Throws:
IllegalArgumentException
- if the selected range is provably out-of-bounds or otherwise invalid
-
head
Returns a function that returns the head of the extracted byte array.If the requested length is negative then an
IllegalArgumentException
will be thrown by this method. If the requested length is found to be out-of-bounds at evaluation time then the returned function will throwIndexOutOfBoundsException
.- Parameters:
length
- head length- Returns:
- a head reading function
- Throws:
IllegalArgumentException
- if the length is negative
-
tail
Returns a function that returns the tail of the extracted byte array.If the requested length is negative then an
IllegalArgumentException
will be thrown by this method. If the requested length is found to be out-of-bounds at evaluation time then the returned function will throwIndexOutOfBoundsException
.- Parameters:
length
- tail length- Returns:
- a tail reading function
- Throws:
IllegalArgumentException
- if the length is negative
-
insert
Returns a function that inserts the provided array at a specific offset.If the insertion is provably out-of-bounds or otherwise invalid then an
IllegalArgumentException
will be thrown by this method. If the insertion is found to be out-of-bounds at evaluation time then the returned function will throwIndexOutOfBoundsException
.- Parameters:
at
- insertion indexdata
- array to insert- Returns:
- an array insertion function
- Throws:
IllegalArgumentException
- if the insertion is provably out-of-bounds or otherwise invalid
-
remove
Returns a function that removes bytes in a given range.If the removal is provably out-of-bounds or otherwise invalid then an
IllegalArgumentException
will be thrown by this method. If the removal is found to be out-of-bounds at evaluation time then the returned function will throwIndexOutOfBoundsException
.- Parameters:
start
- inclusive range startend
- exclusive range end- Returns:
- an range removal function
- Throws:
IllegalArgumentException
- if the removal is provably out-of-bounds or otherwise invalid
-
append
Returns a function that appends the provided array.- Parameters:
data
- array to append- Returns:
- an array appending function
-
truncate
Returns a function that removescount
bytes from the end of the array.If the requested count is negative then an
IllegalArgumentException
will be thrown by this method. If the truncation is found to be out-of-bounds at evaluation time then the returned function will throwIndexOutOfBoundsException
.- Parameters:
count
- number of bytes to remove- Returns:
- a truncation function
- Throws:
IllegalArgumentException
- if the count is negative
-