An alias for {@link HttpPredicate#get} prefix (/**), useful for file system mapping.
<p>
Creates a {@link Predicate} based on a URI template filtering .
<p>
This will listen for WebSocket Method.

@return The new {@link Predicate}.


@see Predicate
518100
public static Predicate<HttpServerRequest> prefix(String prefix, HttpMethod method) {
		Objects.requireNonNull(prefix, "Prefix must be provided");

		String target = prefix.startsWith("/") ? prefix : "/".concat(prefix);
		//target = target.endsWith("/") ? target :  prefix.concat("/");
		return new HttpPrefixPredicate(target, method);
	}
67149
public static <T> Predicate<T> predicate(CheckedPredicate<T> predicate) {
        return predicate(predicate, THROWABLE_TO_RUNTIME_EXCEPTION);
    }
865720
public String findUriByPrefix(String prefix)
    {
        /* This is quite simple: just need to locate the last mapping
         * for the prefix, if any:
         */
        String[] strs = mNsStrings;
        int phash = prefix.hashCode();

        for (int ix = mScopeEnd - 2; ix >= 0; ix -= 2) {
            String thisP = strs[ix];
            if (thisP == prefix ||
                (thisP.hashCode() == phash && thisP.equals(prefix))) {
                return strs[ix+1];
            }
        }
        return null;
    }
686842
public CloseableIterator<CaptureSearchResult> getPrefixReverseIterator(String prefix)
			throws ResourceIndexNotAvailableException {

		if(getState() != STATE_SYNCHED) {
			throw new ResourceIndexNotAvailableException("Not synchronized");
		}
		return super.getPrefixReverseIterator(prefix);
	}
587762
public static Predicate<HttpServerRequest> http(String uri,
			@Nullable HttpVersion protocol,
			HttpMethod method) {
		if (null == uri) {
			return null;
		}

		return new HttpPredicate(uri, protocol, method);
	}
65301
function(uri) {
        var prefix = null;
        if(uri == null) {
            prefix = this.namespaces[this.defaultPrefix];
        } else {
            for(prefix in this.namespaces) {
                if(this.namespaces[prefix] == uri) {
                    break;
                }
            }
        }
        return prefix;
    }
30505
@Deprecated
    public void setPrefix(String prefix) {
        if (prefix == null) {
            throw new IllegalArgumentException(
                    "Prefix cannot be null for a replication rule");
        }
        if (filter != null) {
            throw new IllegalArgumentException(
                    "You cannot use both prefix and filter at the same time in a replication rule");
        }
        this.prefix = prefix;
    }
717185
public String declarePrefix(String uri){
        String prefix = findPrefix(uri);
        if(prefix==null){
            if(uri.isEmpty())
                prefix = ""; // non-empty prefix cannot be used for empty namespace
            else{
                prefix = suggested.getProperty(uri, suggestPrefix);
                if(getURI(prefix)!=null){
                    if(prefix.isEmpty())
                        prefix = "ns";
                    int i = 1;
                    String _prefix;
                    while(true){
                        _prefix = prefix + i;
                        if(getURI(_prefix)==null){
                            prefix = _prefix;
                            break;
                        }
                        i++;
                    }
                }
            }
            declarePrefix(prefix, uri);
        }
        return prefix;
    }
1063925
private Predicate<com.datastax.driver.core.Host> getHostFilterPredicate(String hostFilterPolicy)
    {
        Predicate<com.datastax.driver.core.Host> predicate = null;
        Method getter = null;
        Class<?> hostFilterClazz = null;
        try
        {

            hostFilterClazz = Class.forName(hostFilterPolicy);
            getter = hostFilterClazz.getDeclaredMethod(GET_INSTANCE);

            predicate = (Predicate<com.datastax.driver.core.Host>) getter.invoke(KunderaCoreUtils
                    .createNewInstance(hostFilterClazz));
        }
        catch (ClassNotFoundException e)
        {
            logger.error(e.getMessage());
            throw new KunderaException("Please make sure class " + hostFilterPolicy
                    + " set in property file exists in classpath " + e.getMessage());
        }
        catch (IllegalAccessException e)
        {
            logger.error(e.getMessage());
            throw new KunderaException("Method " + getter.getName() + " must be declared public " + e.getMessage());
        }
        catch (NoSuchMethodException e)
        {
            logger.error(e.getMessage());
            throw new KunderaException("Please make sure getter method of " + hostFilterClazz.getSimpleName()
                    + " is named \"getInstance()\"");
        }
        catch (InvocationTargetException e)
        {
            logger.error(e.getMessage());
            throw new KunderaException("Error while executing \"getInstance()\" method of Class "
                    + hostFilterClazz.getSimpleName() + ": " + e.getMessage());
        }
        catch (SecurityException e)
        {
            logger.error(e.getMessage());
            throw new KunderaException("Encountered security exception while accessing the method: "
                    + "\"getInstance()\"" + e.getMessage());
        }
        return predicate;
    }
446844
public Map<String, V> prefix(@NonNull String prefix) {
      final TrieNode<V> match = root.find(prefix);
      if (match == null) {
         return Collections.emptyMap();
      }
      return new AbstractMap<String, V>() {
         @Override
         public Set<Entry<String, V>> entrySet() {
            return new AbstractSet<Entry<String, V>>() {
               @Override
               public Iterator<Entry<String, V>> iterator() {
                  return Iterators.unmodifiableIterator(new EntryIterator<>(match));
               }

               @Override
               public int size() {
                  return match.size;
               }
            };
         }
      };
   }
283249
public static BodyQName createWithPrefix(
            final String uri,
            final String local,
            final String prefix) {
        if (uri == null || uri.length() == 0) {
            throw(new IllegalArgumentException(
                    "URI is required and may not be null/empty"));
        }
        if (local == null || local.length() == 0) {
            throw(new IllegalArgumentException(
                    "Local arg is required and may not be null/empty"));
        }
        if (prefix == null || prefix.length() == 0) {
            return new BodyQName(new QName(uri, local));
        } else {
            return new BodyQName(new QName(uri, local, prefix));
        }
    }
1065558
public SimpleOrderedMap<Object> create(ComponentPrefix prefix, Boolean encode)
      throws IOException {
    SimpleOrderedMap<Object> mtasPrefixResponse = new SimpleOrderedMap<>();
    mtasPrefixResponse.add("key", prefix.key);
    if (encode) {
      mtasPrefixResponse.add("_encoded_singlePosition",
          MtasSolrResultUtil.encode(prefix.singlePositionList));
      mtasPrefixResponse.add("_encoded_multiplePosition",
          MtasSolrResultUtil.encode(prefix.multiplePositionList));
      mtasPrefixResponse.add("_encoded_setPosition",
          MtasSolrResultUtil.encode(prefix.setPositionList));
      mtasPrefixResponse.add("_encoded_intersecting",
          MtasSolrResultUtil.encode(prefix.intersectingList));
    } else {
      mtasPrefixResponse.add("singlePosition", prefix.singlePositionList);
      mtasPrefixResponse.add("multiplePosition", prefix.multiplePositionList);
      mtasPrefixResponse.add("setPosition", prefix.setPositionList);
      mtasPrefixResponse.add("intersecting", prefix.intersectingList);
    }
    return mtasPrefixResponse;
  }
654256
private HttpPrefixFetchFilter getUriPrefixFecthFilter(Object[] customConfigurations) {
		if (customConfigurations != null) {
			for (Object customConfiguration : customConfigurations) {
				if (customConfiguration instanceof HttpPrefixFetchFilter) {
					return (HttpPrefixFetchFilter) customConfiguration;
				}
			}
		}
		return null;
	}
828737
public static PrefixedProperties createCascadingPrefixProperties(final String prefixString) {
		return prefixString.indexOf(PrefixConfig.PREFIXDELIMITER) != -1
				? createCascadingPrefixProperties(prefixString.split("\\" + PrefixConfig.PREFIXDELIMITER))
				: createCascadingPrefixProperties(new String[] { prefixString });

	}
993177
@NoAuth
    @RequestMapping(value = "/prefix", method = RequestMethod.GET)
    @ResponseBody
    public ValueVo getPrefixUrl() {

        ValueVo confItemVo = new ValueVo();
        confItemVo.setStatus(Constants.OK);
        confItemVo.setValue(zooConfig.getZookeeperUrlPrefix());

        return confItemVo;
    }
221734
public FunctionList prefix(final String prefix) {
        return filter(new Filter() {
            public boolean keep(Function m) {
                return m.getName().startsWith(prefix);
            }
        });
    }
516459
@SequentialOnly
    public static <T> Predicate<T> indexed(final IndexedPredicate<T> predicate) {
        return Predicates.indexed(predicate);
    }