Class PhoneNumberService


  • @Path("phonenumberservice")
    @Produces("application/json")
    @Consumes("application/json")
    public class PhoneNumberService
    extends Object
    phone number web service brings phone number util functions to client.
    Author:
    Manfred Tremmel
    • Constructor Detail

      • PhoneNumberService

        public PhoneNumberService()
    • Method Detail

      • parsePhoneNumber

        @GET
        @Path("parsePhoneNumber")
        public de.knightsoftnet.validators.shared.data.PhoneNumberData parsePhoneNumber​(@QueryParam("language")
                                                                                        String planguage,
                                                                                        @QueryParam("country")
                                                                                        String pcountry,
                                                                                        @QueryParam("phonenumber")
                                                                                        String pphoneNumber)
      • parsePhoneNumber

        @PUT
        @Path("parsewithpos")
        public de.knightsoftnet.validators.shared.data.ValueWithPos<de.knightsoftnet.validators.shared.data.PhoneNumberData> parsePhoneNumber​(ValueWithPosAndCountry<String> pphoneNumber)
      • parseAndFormatPhoneNumber

        @GET
        @Path("parseandformat")
        public PhoneNumberDataWithFormats parseAndFormatPhoneNumber​(@QueryParam("language")
                                                                    String planguage,
                                                                    @QueryParam("country")
                                                                    String pcountry,
                                                                    @QueryParam("phonenumber")
                                                                    String pphoneNumber)
        parse and reformat the phone number in all available formats.
        Parameters:
        planguage - language to use
        pcountry - default country
        pphoneNumber - phone number to format
        Returns:
        PhoneNumberDataWithFormats
      • formatE123

        @GET
        @Path("formate123")
        public String formatE123​(@QueryParam("language")
                                 String planguage,
                                 @QueryParam("country")
                                 String pcountry,
                                 @QueryParam("phonenumber")
                                 String pphoneNumber)
      • formatE123WithPos

        @PUT
        @Path("formate123withpos")
        public de.knightsoftnet.validators.shared.data.ValueWithPos<String> formatE123WithPos​(ValueWithPosAndCountry<String> pphoneNumber)
      • formatE123International

        @GET
        @Path("formate123international")
        public String formatE123International​(@QueryParam("language")
                                              String planguage,
                                              @QueryParam("country")
                                              String pcountry,
                                              @QueryParam("phonenumber")
                                              String pphoneNumber)
      • formatE123InternationalWithPos

        @PUT
        @Path("formate123internationalwithpos")
        public de.knightsoftnet.validators.shared.data.ValueWithPos<String> formatE123InternationalWithPos​(ValueWithPosAndCountry<String> pphoneNumber)
      • formatE123National

        @GET
        @Path("formate123national")
        public String formatE123National​(@QueryParam("language")
                                         String planguage,
                                         @QueryParam("country")
                                         String pcountry,
                                         @QueryParam("phonenumber")
                                         String pphoneNumber)
      • formatE123NationalWithPos

        @PUT
        @Path("formate123nationalwithpos")
        public de.knightsoftnet.validators.shared.data.ValueWithPos<String> formatE123NationalWithPos​(ValueWithPosAndCountry<String> pphoneNumber)
      • formatDin5008

        @GET
        @Path("formatdin5008")
        public String formatDin5008​(@QueryParam("language")
                                    String planguage,
                                    @QueryParam("country")
                                    String pcountry,
                                    @QueryParam("phonenumber")
                                    String pphoneNumber)
      • formatDin5008WithPos

        @PUT
        @Path("formatdin5008withpos")
        public de.knightsoftnet.validators.shared.data.ValueWithPos<String> formatDin5008WithPos​(ValueWithPosAndCountry<String> pphoneNumber)
      • formatDin5008International

        @GET
        @Path("formatdin5008international")
        public String formatDin5008International​(@QueryParam("language")
                                                 String planguage,
                                                 @QueryParam("country")
                                                 String pcountry,
                                                 @QueryParam("phonenumber")
                                                 String pphoneNumber)
      • formatDin5008InternationalWithPos

        @PUT
        @Path("formatdin5008internationalwithpos")
        public de.knightsoftnet.validators.shared.data.ValueWithPos<String> formatDin5008InternationalWithPos​(ValueWithPosAndCountry<String> pphoneNumber)
      • formatDin5008National

        @GET
        @Path("formatdin5008national")
        public String formatDin5008National​(@QueryParam("language")
                                            String planguage,
                                            @QueryParam("country")
                                            String pcountry,
                                            @QueryParam("phonenumber")
                                            String pphoneNumber)
      • formatDin5008NationalWithPos

        @PUT
        @Path("formatdin5008nationalwithpos")
        public de.knightsoftnet.validators.shared.data.ValueWithPos<String> formatDin5008NationalWithPos​(ValueWithPosAndCountry<String> pphoneNumber)
      • formatRfc3966

        @GET
        @Path("formatrfc3966")
        public String formatRfc3966​(@QueryParam("language")
                                    String planguage,
                                    @QueryParam("country")
                                    String pcountry,
                                    @QueryParam("phonenumber")
                                    String pphoneNumber)
      • formatRfc3966WithPos

        @PUT
        @Path("formatrfc3966withpos")
        public de.knightsoftnet.validators.shared.data.ValueWithPos<String> formatRfc3966WithPos​(ValueWithPosAndCountry<String> pphoneNumber)
      • formatMs

        @GET
        @Path("formatms")
        public String formatMs​(@QueryParam("language")
                               String planguage,
                               @QueryParam("country")
                               String pcountry,
                               @QueryParam("phonenumber")
                               String pphoneNumber)
      • formatMsWithPos

        @PUT
        @Path("formatmswithpos")
        public de.knightsoftnet.validators.shared.data.ValueWithPos<String> formatMsWithPos​(ValueWithPosAndCountry<String> pphoneNumber)
      • formatUrl

        @GET
        @Path("formaturl")
        public String formatUrl​(@QueryParam("language")
                                String planguage,
                                @QueryParam("country")
                                String pcountry,
                                @QueryParam("phonenumber")
                                String pphoneNumber)
      • formatUrlWithPos

        @PUT
        @Path("formaturlwithpos")
        public de.knightsoftnet.validators.shared.data.ValueWithPos<String> formatUrlWithPos​(ValueWithPosAndCountry<String> pphoneNumber)
      • formatCommon

        @GET
        @Path("formatcommon")
        public String formatCommon​(@QueryParam("language")
                                   String planguage,
                                   @QueryParam("country")
                                   String pcountry,
                                   @QueryParam("phonenumber")
                                   String pphoneNumber)
      • formatCommonWithPos

        @PUT
        @Path("formatcommonwithpos")
        public de.knightsoftnet.validators.shared.data.ValueWithPos<String> formatCommonWithPos​(ValueWithPosAndCountry<String> pphoneNumber)
      • formatCommonInternational

        @GET
        @Path("formatcommoninternational")
        public String formatCommonInternational​(@QueryParam("language")
                                                String planguage,
                                                @QueryParam("country")
                                                String pcountry,
                                                @QueryParam("phonenumber")
                                                String pphoneNumber)
      • formatCommonInternationalWithPos

        @PUT
        @Path("formatcommoninternationalwithpos")
        public de.knightsoftnet.validators.shared.data.ValueWithPos<String> formatCommonInternationalWithPos​(ValueWithPosAndCountry<String> pphoneNumber)
      • formatCommonNational

        @GET
        @Path("formatcommonnational")
        public String formatCommonNational​(@QueryParam("language")
                                           String planguage,
                                           @QueryParam("country")
                                           String pcountry,
                                           @QueryParam("phonenumber")
                                           String pphoneNumber)
      • formatCommonNationalWithPos

        @PUT
        @Path("formatcommonnationalwithpos")
        public de.knightsoftnet.validators.shared.data.ValueWithPos<String> formatCommonNationalWithPos​(ValueWithPosAndCountry<String> pphoneNumber)
      • getSuggestions

        @GET
        @Path("getsuggestions")
        public List<de.knightsoftnet.validators.shared.data.PhoneNumberData> getSuggestions​(@QueryParam("language")
                                                                                            String planguage,
                                                                                            @QueryParam("search")
                                                                                            String psearch,
                                                                                            @QueryParam("limit")
                                                                                            int plimit)
      • getPhoneCountryConstants

        @GET
        @Path("phonecountryconstants/{language}")
        public Map<String,​de.knightsoftnet.validators.shared.data.PhoneCountryData> getPhoneCountryConstants​(@PathParam("language")
                                                                                                                   String planguage)
        return phone country constants.
        Parameters:
        planguage - language for which should language specific values be requested
        Returns:
        PhoneCountrySharedConstants
      • validate

        @GET
        @Path("validate")
        public Boolean validate​(@QueryParam("country")
                                String pcountry,
                                @QueryParam("phonenumber")
                                String pphoneNumber,
                                @QueryParam("din5008")
                                Boolean pdin5008,
                                @QueryParam("e123")
                                Boolean pe123,
                                @QueryParam("uri")
                                Boolean puri,
                                @QueryParam("ms")
                                Boolean pms,
                                @QueryParam("common")
                                Boolean pcommon)
        validate a phone number.
        Parameters:
        pcountry - default country
        pphoneNumber - phone number to check
        pdin5008 - set to true if DIN 5008 format is allowed
        pe123 - set to true if E123 format is allowed
        puri - set to true if URI format is allowed
        pms - set to true if Microsoft format is allowed
        pcommon - set to true if common format is allowed
        Returns:
        true if number is valid