java.lang.Object
dev.metaschema.core.metapath.function.library.ArrayPut

public final class ArrayPut extends Object
Implements the XPath 3.1 array:put function.
  • Method Details

    • put

      @NonNull public static <T extends ICollectionValue> IArrayItem<T> put(@NonNull IArrayItem<T> array, @NonNull IIntegerItem positionItem, @NonNull T member)
      An implementation of XPath 3.1 array:put.
      Type Parameters:
      T - the type of items in the given Metapath array
      Parameters:
      array - the target Metapath array
      positionItem - the integer position of the item to replace
      member - the Metapath item to replace the identified array member with
      Returns:
      a new array containing the modification
      Throws:
      NegativeLengthArrayMetapathException - if the position is negative
      IndexOutOfBoundsArrayMetapathException - if the position is not in the range of 1 to array:size
    • put

      @NonNull public static <T extends ICollectionValue> IArrayItem<T> put(@NonNull IArrayItem<T> array, int position, @NonNull T member)
      An implementation of XPath 3.1 array:put.
      Type Parameters:
      T - the type of items in the given Metapath array
      Parameters:
      array - the target Metapath array
      position - the integer position of the item to replace
      member - the Metapath item to replace the identified array member with
      Returns:
      a new array containing the modification
      Throws:
      NegativeLengthArrayMetapathException - if the position is negative
      IndexOutOfBoundsArrayMetapathException - if the position is not in the range of 1 to array:size