Class DefaultTypeOfAddressParser

  • All Implemented Interfaces:
    TypeOfAddressParser

    public class DefaultTypeOfAddressParser
    extends java.lang.Object
    implements TypeOfAddressParser
    Default implementation of TypeOfAddressParser interface. Supports international and alphanumeric ton parameters, otherwise return Ton.UNKNOWN
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @NotNull com.cloudhopper.commons.gsm.TypeOfAddress getDestination​(@NotNull java.lang.String destination)
      Create TON and NPI parameters for message destination destination.
      @NotNull com.cloudhopper.commons.gsm.TypeOfAddress getSource​(@NotNull java.lang.String source)
      Create TON and NPI parameters for message source source.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultTypeOfAddressParser

        public DefaultTypeOfAddressParser()
    • Method Detail

      • getSource

        @NotNull
        public @NotNull com.cloudhopper.commons.gsm.TypeOfAddress getSource​(@NotNull
                                                                            @NotNull java.lang.String source)
        Create TON and NPI parameters for message source source. Supported two types of source: international or alphanumeric, otherwise return Ton.UNKNOWN
        Specified by:
        getSource in interface TypeOfAddressParser
        Parameters:
        source - message source
        Returns:
        ton and npi for source
        Throws:
        IllegalAddressException - if exception occurs
      • getDestination

        @NotNull
        public @NotNull com.cloudhopper.commons.gsm.TypeOfAddress getDestination​(@NotNull
                                                                                 @NotNull java.lang.String destination)
        Create TON and NPI parameters for message destination destination. If number in international number format returns Ton.INTERNATIONAL, otherwise return Ton.UNKNOWN
        Specified by:
        getDestination in interface TypeOfAddressParser
        Parameters:
        destination - message destination
        Returns:
        ton and npi for destination
        Throws:
        IllegalAddressException - if exception occurs