Interface BuildableBytesOptionalFunction<T>

All Superinterfaces:
BuildableOptionalFunction<T,byte[]>, Function<T,Optional<byte[]>>

public interface BuildableBytesOptionalFunction<T> extends BuildableOptionalFunction<T,byte[]>
A function of one argument that generates an Optional<byte[]> result, and supports building derived functional types.
  • Method Details

    • length

      Returns a function that maps the length of the extracted byte array.
      Returns:
      a byte array length function
    • range

      default BuildableBytesOptionalFunction<T> range(int start, int end)
      Returns a function that maps 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 throw IndexOutOfBoundsException.

      Parameters:
      start - inclusive range start
      end - exclusive range end
      Returns:
      a range reading function
      Throws:
      IllegalArgumentException - if the selected range is provably out-of-bounds or otherwise invalid
    • head

      default BuildableBytesOptionalFunction<T> head(int length)
      Returns a function that maps 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 throw IndexOutOfBoundsException.

      Parameters:
      length - head length
      Returns:
      a head reading function
      Throws:
      IllegalArgumentException - if the length is negative
    • tail

      default BuildableBytesOptionalFunction<T> tail(int length)
      Returns a function that maps 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 throw IndexOutOfBoundsException.

      Parameters:
      length - tail length
      Returns:
      a tail reading function
      Throws:
      IllegalArgumentException - if the length is negative