Class ScriptFilter<V>

java.lang.Object
com.tangosol.util.AbstractScript
com.tangosol.util.filter.ScriptFilter<V>
Type Parameters:
V - the type of the value this Filter receives
All Implemented Interfaces:
ExternalizableLite, PortableObject, Filter<V>, Serializable

public class ScriptFilter<V> extends AbstractScript implements Filter<V>
ScriptFilter is a Filter that wraps a script written in one of the languages supported by Graal VM.
Since:
14.1.1.0
Author:
mk 2019.07.26
See Also:
  • Constructor Details

    • ScriptFilter

      public ScriptFilter()
      Default constructor for deserialization.
    • ScriptFilter

      public ScriptFilter(String language, String name, Object... args)
      Create a Filter that wraps the specified script.
      Parameters:
      language - the language the script is written. Currently, only "js" (for JavaScript) is supported
      name - the name of the Filter that needs to be evaluated
      args - the arguments to be passed to the script during evaluation
  • Method Details

    • evaluate

      public boolean evaluate(V entry)
      Description copied from interface: Filter
      Apply the test to the input argument.
      Specified by:
      evaluate in interface Filter<V>
      Parameters:
      entry - the input argument to evaluate
      Returns:
      true if the input argument matches the filter, otherwise false