Class OptionsBuilder<T extends OptionsBuilder<T>>

java.lang.Object
it.auties.whatsapp.api.OptionsBuilder<T>
Direct Known Subclasses:
MobileOptionsBuilder, WebOptionsBuilder

public sealed class OptionsBuilder<T extends OptionsBuilder<T>> extends Object permits MobileOptionsBuilder, WebOptionsBuilder
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) ErrorHandler
     
    (package private) Keys
     
    (package private) ExecutorService
     
    (package private) Store
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    OptionsBuilder(Store store, Keys keys)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    autodetectListeners(boolean autodetectListeners)
    Sets whether listeners marked with the RegisterListener annotation should be automatically detected and registered By default, this option is enabled
    automaticPresenceUpdates(boolean automaticPresenceUpdates)
    Whether presence updates should be handled automatically
    checkPatchMacks(boolean checkPatchMacs)
    Sets whether the mac of every app state patch should be validated or not By default, it's set to false
    errorHandler(ErrorHandler errorHandler)
    Sets the error handler for this session
    name(String name)
    Sets the name to provide to Whatsapp during the authentication process The web api will display this name in the devices section, while the mobile api will show it to the people you send messages to By default, this value will be set to this library's name
    proxy(URI proxy)
    Sets the proxy to use for the socket
    Sets the release channel
    Sets the executor to use for the socket
    Sets whether a preview should be automatically generated and attached to text messages that contain links By default, it's enabled with inference
    version(Version version)
    Sets the version of Whatsapp to use If the version is too outdated, the server will refuse to connect If you are using the mobile api and the version doesn't match the hash, the server will refuse to connect By default the latest stable version will be used

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • OptionsBuilder

      OptionsBuilder(Store store, Keys keys)
  • Method Details

    • name

      public T name(String name)
      Sets the name to provide to Whatsapp during the authentication process The web api will display this name in the devices section, while the mobile api will show it to the people you send messages to By default, this value will be set to this library's name
      Returns:
      the same instance for chaining
    • version

      public T version(Version version)
      Sets the version of Whatsapp to use If the version is too outdated, the server will refuse to connect If you are using the mobile api and the version doesn't match the hash, the server will refuse to connect By default the latest stable version will be used
      Returns:
      the same instance for chaining
    • autodetectListeners

      public T autodetectListeners(boolean autodetectListeners)
      Sets whether listeners marked with the RegisterListener annotation should be automatically detected and registered By default, this option is enabled
      Returns:
      the same instance for chaining
    • textPreviewSetting

      public T textPreviewSetting(TextPreviewSetting textPreviewSetting)
      Sets whether a preview should be automatically generated and attached to text messages that contain links By default, it's enabled with inference
      Returns:
      the same instance for chaining
    • errorHandler

      public T errorHandler(ErrorHandler errorHandler)
      Sets the error handler for this session
      Returns:
      the same instance for chaining
    • socketExecutor

      public T socketExecutor(ExecutorService socketExecutor)
      Sets the executor to use for the socket
      Returns:
      the same instance for chaining
    • releaseChannel

      public T releaseChannel(UserAgent.ReleaseChannel releaseChannel)
      Sets the release channel
      Returns:
      the same instance for chaining
    • proxy

      public T proxy(URI proxy)
      Sets the proxy to use for the socket
      Returns:
      the same instance for chaining
    • automaticPresenceUpdates

      public T automaticPresenceUpdates(boolean automaticPresenceUpdates)
      Whether presence updates should be handled automatically
      Returns:
      the same instance for chaining
    • checkPatchMacks

      public T checkPatchMacks(boolean checkPatchMacs)
      Sets whether the mac of every app state patch should be validated or not By default, it's set to false
      Returns:
      the same instance for chaining