Record Class WebEngineClassifier.Client

java.lang.Object
java.lang.Record
com.iizix.server.webengine.WebEngineClassifier.Client
Record Components:
userAgent - navigator.userAgent, may be null.
cordova - izr.cordova, non-null only in iiziRun (as EnvProps.isCordova).
osVersion - izr.osversion, the device's OS version in iiziRun, may be null.
platform - izr.platform, e.g. "Android" or "iOS", may be null.
Enclosing class:
WebEngineClassifier

public static record WebEngineClassifier.Client(String userAgent, String cordova, String osVersion, String platform) extends Record
The client values the classifier reads, from the client's environment.
Author:
Christopher Mindus
  • Constructor Details

    • Client

      public Client(String userAgent, String cordova, String osVersion, String platform)
      Creates an instance of a Client record class.
      Parameters:
      userAgent - the value for the userAgent record component
      cordova - the value for the cordova record component
      osVersion - the value for the osVersion record component
      platform - the value for the platform record component
  • Method Details

    • browser

      public static WebEngineClassifier.Client browser(String userAgent)
      Creates a Browser client: a user agent and nothing else.
      Parameters:
      userAgent - The user agent.
      Returns:
      The client.
    • isIiziRun

      public boolean isIiziRun()
      Tests if the client is iiziRun.
      Returns:
      true if izr.cordova is present.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • userAgent

      public String userAgent()
      Returns the value of the userAgent record component.
      Returns:
      the value of the userAgent record component
    • cordova

      public String cordova()
      Returns the value of the cordova record component.
      Returns:
      the value of the cordova record component
    • osVersion

      public String osVersion()
      Returns the value of the osVersion record component.
      Returns:
      the value of the osVersion record component
    • platform

      public String platform()
      Returns the value of the platform record component.
      Returns:
      the value of the platform record component