All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.redis.om.spring.search.stream.actions.ArrayInsertAction Maven / Gradle / Ivy

package com.redis.om.spring.search.stream.actions;

import java.lang.reflect.Field;
import java.util.function.Consumer;

import com.redislabs.modules.rejson.Path;

public class ArrayInsertAction extends BaseAbstractAction implements Consumer {
  
  private Object value;
  private Long index;

  public ArrayInsertAction(Field field, Object value, Long index) {
    super(field);
    this.value = value;
    this.index = index;
  }

  @Override
  public void accept(E entity) {
    json.arrInsert(getKey(entity), Path.of("." + field.getName()), index, value);
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy