Package nl.basjes.parse.useragent
Class AbstractUserAgentAnalyzer.AbstractUserAgentAnalyzerBuilder<UAA extends AbstractUserAgentAnalyzer,B extends AbstractUserAgentAnalyzer.AbstractUserAgentAnalyzerBuilder<UAA,B>>
java.lang.Object
nl.basjes.parse.useragent.AbstractUserAgentAnalyzerDirect.AbstractUserAgentAnalyzerDirectBuilder<UAA,B>
nl.basjes.parse.useragent.AbstractUserAgentAnalyzer.AbstractUserAgentAnalyzerBuilder<UAA,B>
- Direct Known Subclasses:
UserAgentAnalyzer.UserAgentAnalyzerBuilder
,UserAgentStringMatchMakerTester.AbstractUserAgentAnalyzerTesterBuilder
- Enclosing class:
- AbstractUserAgentAnalyzer
public abstract static class AbstractUserAgentAnalyzer.AbstractUserAgentAnalyzerBuilder<UAA extends AbstractUserAgentAnalyzer,B extends AbstractUserAgentAnalyzer.AbstractUserAgentAnalyzerBuilder<UAA,B>>
extends AbstractUserAgentAnalyzerDirect.AbstractUserAgentAnalyzerDirectBuilder<UAA,B>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Construct the analyzer and run the preheat sequence (if requested).Use a Java 8 compatible caching implementation for the UserAgents and the client hints.withCache
(int newCacheSize) Specify a new cache size (0 = disable caching).withCacheInstantiator
(AbstractUserAgentAnalyzer.CacheInstantiator cacheInstantiator) Specify a custom class to create the cache.withClientHintCacheInstantiator
(AbstractUserAgentAnalyzer.ClientHintsCacheInstantiator<?> cacheInstantiator) Specify a custom class to create the ClientHint cache.withClientHintsCache
(int newCacheSize) Specify a new ClientHint cache size (0 = disable caching).Disable caching.Disable ClientHint caching.Methods inherited from class nl.basjes.parse.useragent.AbstractUserAgentAnalyzerDirect.AbstractUserAgentAnalyzerDirectBuilder
addOptionalResources, addResources, addYamlRule, delayInitialization, dropDefaultResources, dropTests, failIfAlreadyBuilt, hideMatcherLoadStats, immediateInitialization, keepTests, preheat, preheat, showFullVersion, showMatcherLoadStats, showMinimalVersion, withAllFields, withField, withFields, withFields, withUserAgentMaxLength
-
Constructor Details
-
AbstractUserAgentAnalyzerBuilder
-
-
Method Details
-
withCache
Specify a new cache size (0 = disable caching).- Parameters:
newCacheSize
- The new cache size value- Returns:
- the current Builder instance.
-
withoutCache
Disable caching.- Returns:
- the current Builder instance.
-
withCacheInstantiator
Specify a custom class to create the cache. Use this if the default Caffeine cache is unsuitable for your needs.- Parameters:
cacheInstantiator
- The class that will create a new cache instance when requested.- Returns:
- the current Builder instance.
-
withClientHintsCache
Specify a new ClientHint cache size (0 = disable caching).- Parameters:
newCacheSize
- The new cache size value- Returns:
- the current Builder instance.
-
withoutClientHintsCache
Disable ClientHint caching.- Returns:
- the current Builder instance.
-
withClientHintCacheInstantiator
public B withClientHintCacheInstantiator(AbstractUserAgentAnalyzer.ClientHintsCacheInstantiator<?> cacheInstantiator) Specify a custom class to create the ClientHint cache. Use this if the default Caffeine cache is unsuitable for your needs.- Parameters:
cacheInstantiator
- The class that will create a new cache instance when requested.- Returns:
- the current Builder instance.
-
useJava8CompatibleCaching
Use a Java 8 compatible caching implementation for the UserAgents and the client hints.- Returns:
- the current Builder instance.
-
build
Description copied from class:AbstractUserAgentAnalyzerDirect.AbstractUserAgentAnalyzerDirectBuilder
Construct the analyzer and run the preheat sequence (if requested).- Overrides:
build
in classAbstractUserAgentAnalyzerDirect.AbstractUserAgentAnalyzerDirectBuilder<UAA extends AbstractUserAgentAnalyzer,
B extends AbstractUserAgentAnalyzer.AbstractUserAgentAnalyzerBuilder<UAA, B>> - Returns:
- the new analyzer instance.
-