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
appVersion - the version of the app, or empty
osVersion - the non-null os version of the device
All Implemented Interfaces:
it.auties.protobuf.model.ProtobufMessage, it.auties.protobuf.model.ProtobufObject

public record CompanionDevice(String model, String manufacturer, UserAgent.PlatformType platform, Optional<Version> appVersion, Version osVersion) extends Record implements it.auties.protobuf.model.ProtobufMessage
A model for a mobile companion
  • Field Details

  • Constructor Details

    • CompanionDevice

      public CompanionDevice(String model, String manufacturer, UserAgent.PlatformType platform, Optional<Version> appVersion, Version osVersion)
      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
      appVersion - the value for the appVersion record component
      osVersion - the value for the osVersion record component
  • Method Details

    • web

      public static CompanionDevice web()
    • web

      public static CompanionDevice web(Version appVersion)
    • ios

      public static CompanionDevice ios(boolean business)
    • ios

      public static CompanionDevice ios(Version appVersion, boolean business)
    • android

      public static CompanionDevice android(boolean business)
    • android

      public static CompanionDevice android(Version appVersion, boolean business)
    • kaiOs

      public static CompanionDevice kaiOs()
    • kaiOs

      public static CompanionDevice kaiOs(Version appVersion)
    • toUserAgent

      public String toUserAgent(Version appVersion)
    • toPersonal

      public CompanionDevice toPersonal()
    • toBusiness

      public CompanionDevice toBusiness()
    • 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
    • appVersion

      public Optional<Version> appVersion()
      Returns the value of the appVersion record component.
      Returns:
      the value of the appVersion record component
    • osVersion

      public Version osVersion()
      Returns the value of the osVersion record component.
      Returns:
      the value of the osVersion record component