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

edu.uiuc.ncsa.security.util.functor.logic.jContains Maven / Gradle / Ivy

package edu.uiuc.ncsa.security.util.functor.logic;

import static edu.uiuc.ncsa.security.util.functor.FunctorTypeImpl.CONTAINS;

/**
 * contains[needle,haystack]
* This will search for needle in haystack and return true if found. *

Created by Jeff Gaynor
* on 2/27/18 at 10:43 AM */ public class jContains extends jStringComparisons { public jContains() { super(CONTAINS); } @Override public Object execute() { if (executed) { return result; } if (args.size() != 2) { throw new IllegalStateException("Error: this functor requires two arguments. It currently has " + args.size() + " arguments."); } String needle = processArg(args.get(0)); String haystack = processArg(args.get(1)); boolean rc = haystack.contains(needle); result = new Boolean(rc); executed = true; return result; } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy