Class ClientHintsHeadersParser

java.lang.Object
nl.basjes.parse.useragent.clienthints.ClientHintsHeadersParser
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ClientHintsAnalyzer

public class ClientHintsHeadersParser extends Object implements Serializable
See Also:
  • Field Details

    • LOG

      public static final org.apache.logging.log4j.Logger LOG
  • Constructor Details

    • ClientHintsHeadersParser

      public ClientHintsHeadersParser()
  • Method Details

    • supportedClientHintHeaders

      public List<String> supportedClientHintHeaders()
    • isSupportedClientHintHeader

      public boolean isSupportedClientHintHeader(String header)
    • configureKryo

      public static void configureKryo(Object kryoInstance)
      This is used to configure the provided Kryo instance if Kryo serialization is desired. The expected type here is Object because otherwise the Kryo library becomes a mandatory dependency on any project that uses Yauaa.
      Parameters:
      kryoInstance - The instance of com.esotericsoftware.kryo.Kryo that needs to be configured.
    • parse

      public ClientHints parse(Map<String,String> requestHeaders)
      Tries to find as much usefull information from the client Headers as possible.
      Parameters:
      requestHeaders - The full list of available request headers that may contain some useable Client Hints.
      Returns:
      An instance of ClientHints. Possibly without anything in it.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getCacheSize

      public int getCacheSize()
    • setCacheSize

      public void setCacheSize(int newClientHintsCacheSize)
    • setCacheInstantiator

      public void setCacheInstantiator(AbstractUserAgentAnalyzer.ClientHintsCacheInstantiator<?> newClientHintsCacheInstantiator)
    • initializeCache

      public void initializeCache()
    • clearCache

      public void clearCache()