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 Details

    • AbstractUserAgentAnalyzerBuilder

      protected AbstractUserAgentAnalyzerBuilder(UAA newUaa)
  • Method Details

    • withCache

      public B withCache(int newCacheSize)
      Specify a new cache size (0 = disable caching).
      Parameters:
      newCacheSize - The new cache size value
      Returns:
      the current Builder instance.
    • withoutCache

      public B withoutCache()
      Disable caching.
      Returns:
      the current Builder instance.
    • withCacheInstantiator

      public B withCacheInstantiator(AbstractUserAgentAnalyzer.CacheInstantiator cacheInstantiator)
      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

      public B withClientHintsCache(int newCacheSize)
      Specify a new ClientHint cache size (0 = disable caching).
      Parameters:
      newCacheSize - The new cache size value
      Returns:
      the current Builder instance.
    • withoutClientHintsCache

      public B 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

      public B useJava8CompatibleCaching()
      Use a Java 8 compatible caching implementation for the UserAgents and the client hints.
      Returns:
      the current Builder instance.
    • build

      public UAA build()
      Construct the analyzer and run the preheat sequence (if requested).
      Overrides:
      build in class AbstractUserAgentAnalyzerDirect.AbstractUserAgentAnalyzerDirectBuilder<UAA extends AbstractUserAgentAnalyzer,B extends AbstractUserAgentAnalyzer.AbstractUserAgentAnalyzerBuilder<UAA,B>>
      Returns:
      the new analyzer instance.