Package com.vonage.client.users.channels
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
Base class for channels.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetConcreteClass(ChannelType type) Finds the corresponding subclass of Channel based on the enum's value.getType()If thetypefield is present in JSON payload, returns the value as an enum.voidvoidSets thegetType()based on this class's type.Methods inherited from class com.vonage.client.JsonableBaseObject
createJsonObjectMapper, equals, hashCode, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.vonage.client.Jsonable
toJson, updateFromJson
-
Field Details
-
type
-
-
Constructor Details
-
Channel
public Channel()
-
-
Method Details
-
getType
If thetypefield 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
nullif absent or not applicable in this context. - Since:
- 8.4.0
-
setTypeField
Sets thegetType()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
This method makesgetType()returnnull; 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
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
nullif there isn't one. - Since:
- 8.4.0
-