Record Class CompanionDevice

java.lang.Object
java.lang.Record
it.auties.whatsapp.model.companion.CompanionDevice
Record Components:
model - the non-null model of the device
manufacturer - the non-null manufacturer of the device
platform - the non-null os of the device
version - the non-null os version of the device

public record CompanionDevice(String model, String manufacturer, UserAgent.PlatformType platform, String version) extends Record
A model for a mobile companion
  • Field Details

    • model

      private final String model
      The field for the model record component.
    • manufacturer

      private final String manufacturer
      The field for the manufacturer record component.
    • platform

      private final UserAgent.PlatformType platform
      The field for the platform record component.
    • version

      private final String version
      The field for the version record component.
  • Constructor Details

    • CompanionDevice

      public CompanionDevice(String model, String manufacturer, UserAgent.PlatformType platform, String version)
      Creates an instance of a CompanionDevice record class.
      Parameters:
      model - the value for the model record component
      manufacturer - the value for the manufacturer record component
      platform - the value for the platform record component
      version - the value for the version record component
  • Method Details

    • web

      public static CompanionDevice web()
    • ios

      public static CompanionDevice ios(boolean business)
    • android

      public static CompanionDevice android(boolean business)
    • kaiOs

      public static CompanionDevice kaiOs()
    • toUserAgent

      public String toUserAgent(Version appVersion)
    • deviceVersion

      private String deviceVersion()
    • deviceName

      private String deviceName()
    • platformName

      private String platformName()
    • 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.
    • model

      public String model()
      Returns the value of the model record component.
      Returns:
      the value of the model record component
    • manufacturer

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

      public UserAgent.PlatformType platform()
      Returns the value of the platform record component.
      Returns:
      the value of the platform record component
    • version

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