/*
(non-Javadoc)

@see org.archive.wayback.resourceindex.SearchResultSource#getPrefixIterator(java.lang.String)
160309
public CloseableIterator<CaptureSearchResult> getPrefixIterator(String prefix)
			throws ResourceIndexNotAvailableException {
		if(getState() != STATE_SYNCHED) {
			throw new ResourceIndexNotAvailableException("Not synchronized");
		}
		return super.getPrefixIterator(prefix);
	}
902730
@Nonnull
	public static LCharIntPredicate charIntPredicateFrom(Consumer<LCharIntPredicateBuilder> buildingFunction) {
		LCharIntPredicateBuilder builder = new LCharIntPredicateBuilder();
		buildingFunction.accept(builder);
		return builder.build();
	}
802714
public final String getExplicitPrefix(String uri)
    {
        if (mNsMapping != null) {
            String prefix = mNsMapping.findPrefixByUri(uri);
            if (prefix != null) {
                return prefix;
            }
        }
        if (mRootNsContext != null) {
            String prefix = mRootNsContext.getPrefix(uri);
            if (prefix != null) {
                // Hmmh... still can't use the default NS:
                if (prefix.length() > 0) {
                    return prefix;
                }
                // ... should we try to find an explicit one?
            }
        }
        return null;
    }
629105
private String getPrefixItem(String requirement, String minVersion, String maxVersion) {
        
        switch (requirement) {
        case Languages.JAVA: return "java";
        case Languages.PYTHON: return "python";
        case Languages.RUBY: return "ruby";
        case Languages.NET: return "dotnet";
        case Languages.PHP: return "php";
        
        case Containers.JBOSS6: return "jboss";
        case Containers.JBOSS7: return "jboss";
        case Containers.JETTY6: return "jetty";
        case Containers.TOMCAT: return "tomcat";
        case Containers.TOMCAT8: return "tomcat";

        case Categories.MYSQL: return "mysql";
        case Categories.MARIADB: return "maria";
        case Categories.POSTGRESQL: return "postgresql";
        case Categories.MONGODB: return "mongoDB";
        case Categories.REDIS: return "redis";

        default:
            return "";
        }
    }
66337
@Override
    public <T> CachedResource<T> getResource(
            Resource resource, Loader<T> builder, long checkInterval) throws IOException {
        if (Included.PLAIN == this.resourcesElementsProvider.getDefaultIncludedType()) {
            this.logger.trace(
                    "Resoure Aggregation Disabled, ignoring resource cache and loading '"
                            + resource
                            + "' directly");
            return this.loadResource(resource, builder);
        }

        // Look for the resource in the cache, since it has been wrapped with a SelfPopulatingCache
        // it should never return null.
        final GetResourceArguments<T> arguments = new GetResourceArguments<T>(resource, builder);
        final Element element =
                this.entryFactory.getWithData(this.resourceCache, resource, arguments);

        CachedResource<T> cachedResource = (CachedResource<T>) element.getObjectValue();
        if (this.logger.isTraceEnabled()) {
            this.logger.trace("Found " + cachedResource + " in cache");
        }

        // Found it, now check if the last-load time is within the check interval
        final long lastCheckTime = cachedResource.getLastCheckTime();
        if (lastCheckTime + checkInterval >= System.currentTimeMillis()) {
            if (this.logger.isTraceEnabled()) {
                this.logger.trace(
                        cachedResource
                                + " is within checkInterval "
                                + checkInterval
                                + ", returning");
            }
            return cachedResource;
        }
        if (this.logger.isTraceEnabled()) {
            this.logger.trace(
                    cachedResource
                            + " is older than checkInterval "
                            + checkInterval
                            + ", checking for modification");
        }

        // If the resource has not been modified return the cached resource.
        final boolean resourceModified = this.checkIfModified(cachedResource);
        if (!resourceModified) {
            cachedResource.setLastCheckTime(System.currentTimeMillis());
            this.resourceCache.put(
                    element); // do a cache put to notify the cache the object has been modified
            return cachedResource;
        }

        // The resource has been modified, reload it.
        cachedResource = this.loadResource(resource, builder);

        // Cache the loaded resource
        this.resourceCache.put(new Element(resource, cachedResource));

        if (this.logger.isDebugEnabled()) {
            this.logger.debug("Loaded and cached " + cachedResource);
        }

        return cachedResource;
    }
592618
public String getPrefix(String namespaceURI)
    {
        String prefix = m_prefixMap.lookupPrefix(namespaceURI);
        return prefix;
    }
1180915
public static SearchExpressionResolver findResolver(final String expression) {
        SearchExpressionResolver resolver = null;

        if (expression.startsWith(SearchExpressionConstants.KEYWORD_PREFIX)) {
            // check if it's an expression with parameter
            int parenthesisPosition = expression.indexOf('(');
            if (parenthesisPosition > 0) {
                String expressionWithoutParam = expression.substring(0, parenthesisPosition);
                resolver = RESOLVER_MAPPING.get(expressionWithoutParam);
            }
            else {
                resolver = RESOLVER_MAPPING.get(expression);
            }
        }
        else {
            // if it's not a keyword, just delegate it to JSF
            resolver = FIND_COMPONENT_EXPRESSION_RESOLVER;
        }

        if (resolver == null) {
            throw new FacesException("No SearchExpressionResolver available for expression \"" + expression + "\"");
        }

        return resolver;
    }
686842
public CloseableIterator<CaptureSearchResult> getPrefixReverseIterator(String prefix)
			throws ResourceIndexNotAvailableException {

		if(getState() != STATE_SYNCHED) {
			throw new ResourceIndexNotAvailableException("Not synchronized");
		}
		return super.getPrefixReverseIterator(prefix);
	}
480265
@Override
    public StandardJavaFileManager getStandardFileManager(
            DiagnosticListener<? super JavaFileObject> diagnosticListener,
            Locale locale,
            Charset charset) {
        Context context = new Context();
        context.put(Locale.class, locale);
        if (diagnosticListener != null)
            context.put(DiagnosticListener.class, diagnosticListener);
        PrintWriter pw = (charset == null)
                ? new PrintWriter(System.err, true)
                : new PrintWriter(new OutputStreamWriter(System.err, charset), true);
        context.put(Log.outKey, pw);
        return new JavacFileManager(context, true, charset);
    }
865096
public ResourceFormatGenerator getGeneratorForFileExtension(final String extension) throws
        UnsupportedFormatException {
        for (final ResourceFormatGenerator generator : listGenerators()) {
            if (generator.getFileExtensions().contains(extension)) {
                return generator;
            }
        }
        throw new UnsupportedFormatException("No provider available to parse file extension: " + extension);
    }
215474
private ExtensionHandler getExtensionHandler(LocalExtension localExtension) throws ComponentLookupException
    {
        return this.componentManager.getInstance(ExtensionHandler.class, localExtension.getType().toLowerCase());
    }
343888
public com.google.api.Distribution.ExemplarOrBuilder getExemplarsOrBuilder(
      int index) {
    return exemplars_.get(index);
  }
217060
public static Resource getResource(String location) {
        Resource resource = resolver.getResource(location);
        return resource.exists() ? resource : null;
    }
1161044
private static FieldType getPlaceholder(final Class<?> type, final int fieldID)
   {
      return new FieldType()
      {
         @Override public FieldTypeClass getFieldTypeClass()
         {
            return FieldTypeClass.UNKNOWN;
         }

         @Override public String name()
         {
            return "UNKNOWN";
         }

         @Override public int getValue()
         {
            return fieldID;
         }

         @Override public String getName()
         {
            return "Unknown " + (type == null ? "" : type.getSimpleName() + "(" + fieldID + ")");
         }

         @Override public String getName(Locale locale)
         {
            return getName();
         }

         @Override public DataType getDataType()
         {
            return null;
         }

         @Override public FieldType getUnitsType()
         {
            return null;
         }

         @Override public String toString()
         {
            return getName();
         }
      };
   }
672106
@Override
	public <T> T get(final String key, final T defaultValue, DomainResolver resolver) {
		final String trimmedKey = trimKey(key);
		KeyValues keyValues = valuesStore.getKeyValuesFromMapOrPersistence(trimmedKey);
		T result;
		if (keyValues == null) {
			result = defaultValue;
		} else {
			result = keyValues.get(domains, defaultValue, resolver);
		}
		if (LOGGER.isDebugEnabled()) {
			LOGGER.debug("Getting value for key: '{}' with given default: '{}'. Returning value: '{}'", trimmedKey, defaultValue, result);
			StringBuilder builder = new StringBuilder("DomainValues: ");
			for (String domain : domains) {
				builder.append(domain).append(" => ").append(resolver.getDomainValue(domain)).append("; ");
			}
			LOGGER.debug(builder.toString());
		}
		return result;
	}
280784
def get_preparer(mixed: Union[SQLCompiler, Engine,
                              Dialect]) -> IdentifierPreparer:
    
    dialect = get_dialect(mixed)
    # noinspection PyUnresolvedReferences
    return dialect.preparer(dialect)
1066458
private SIXAResource getXaResource() throws ResourceException
    {
        final String methodName = "getXaResource";
        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled())
        {
            SibTr.entry(this, TRACE, methodName);
        }

        if (_xaResource == null)
        {
            try
            {
              _xaResource = _connection.getSIXAResource();
            }
            catch (final SIException exception)
            {
                FFDCFilter.processException(exception, CLASS_NAME + "."
                        + methodName, FFDC_PROBE_1, this);
                if (TraceComponent.isAnyTracingEnabled() && TRACE.isEventEnabled())
                {
                    SibTr.exception(this, TRACE, exception);
                }
                throw new ResourceException(NLS.getFormattedMessage(
                        ("XARESOURCE_EXCEPTION_CWSIV0650"), new Object[] {
                                exception, _connection }, null), exception);
            }
            catch (final SIErrorException exception)
            {
                FFDCFilter.processException(exception, CLASS_NAME + "."
                        + methodName, FFDC_PROBE_3, this);
                if (TraceComponent.isAnyTracingEnabled() && TRACE.isEventEnabled()) {
                    SibTr.exception(this, TRACE, exception);
                }
                throw new ResourceException(NLS.getFormattedMessage(
                        ("XARESOURCE_EXCEPTION_CWSIV0650"), new Object[] {
                                exception, _connection }, null), exception);
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled())
        {
            SibTr.exit(this, TRACE, methodName, _xaResource);
        }
        return _xaResource;
    }