Class Channel

java.lang.Object
com.vonage.client.JsonableBaseObject
com.vonage.client.users.channels.Channel
All Implemented Interfaces:
Jsonable
Direct Known Subclasses:
Messenger, Mms, Pstn, Sip, Sms, Vbc, Viber, Websocket, Whatsapp, WhatsappVoice

public abstract class Channel extends JsonableBaseObject
Base class for channels.
  • Field Details

  • Constructor Details

  • Method Details

    • getType

      public ChannelType getType()
      If the type field is present in JSON payload, returns the value as an enum. Usually however, the type can be inferred from the class name. This method is provided for completeness in cases where the field may be present.
      Returns:
      The channel type as an enum, or null if absent or not applicable in this context.
      Since:
      8.4.0
    • setTypeField

      public void setTypeField()
      Sets the getType() based on this class's type. This is useful for some API calls where the type information is expected to be present in the JSON.
      Since:
      8.4.0
      See Also:
    • removeTypeField

      public void removeTypeField()
      This method makes getType() return null; effectively the opposite of setTypeField(). This is useful for some API calls where the type information should be omitted from the generated JSON.
      Since:
      8.4.0
      See Also:
    • getConcreteClass

      public static Class<? extends Channel> getConcreteClass(ChannelType type)
      Finds the corresponding subclass of Channel based on the enum's value.
      Parameters:
      type - The channel type as an enum.
      Returns:
      The appropriate concrete Channel class, or null if there isn't one.
      Since:
      8.4.0