Class PhoneNumberService
- java.lang.Object
-
- de.knightsoftnet.validators.server.rest.api.PhoneNumberService
-
@Path("phonenumberservice") @Produces("application/json") @Consumes("application/json") public class PhoneNumberService extends Objectphone number web service brings phone number util functions to client.- Author:
- Manfred Tremmel
-
-
Constructor Summary
Constructors Constructor Description PhoneNumberService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringformatCommon(String planguage, String pcountry, String pphoneNumber)StringformatCommonInternational(String planguage, String pcountry, String pphoneNumber)de.knightsoftnet.validators.shared.data.ValueWithPos<String>formatCommonInternationalWithPos(ValueWithPosAndCountry<String> pphoneNumber)StringformatCommonNational(String planguage, String pcountry, String pphoneNumber)de.knightsoftnet.validators.shared.data.ValueWithPos<String>formatCommonNationalWithPos(ValueWithPosAndCountry<String> pphoneNumber)de.knightsoftnet.validators.shared.data.ValueWithPos<String>formatCommonWithPos(ValueWithPosAndCountry<String> pphoneNumber)StringformatDin5008(String planguage, String pcountry, String pphoneNumber)StringformatDin5008International(String planguage, String pcountry, String pphoneNumber)de.knightsoftnet.validators.shared.data.ValueWithPos<String>formatDin5008InternationalWithPos(ValueWithPosAndCountry<String> pphoneNumber)StringformatDin5008National(String planguage, String pcountry, String pphoneNumber)de.knightsoftnet.validators.shared.data.ValueWithPos<String>formatDin5008NationalWithPos(ValueWithPosAndCountry<String> pphoneNumber)de.knightsoftnet.validators.shared.data.ValueWithPos<String>formatDin5008WithPos(ValueWithPosAndCountry<String> pphoneNumber)StringformatE123(String planguage, String pcountry, String pphoneNumber)StringformatE123International(String planguage, String pcountry, String pphoneNumber)de.knightsoftnet.validators.shared.data.ValueWithPos<String>formatE123InternationalWithPos(ValueWithPosAndCountry<String> pphoneNumber)StringformatE123National(String planguage, String pcountry, String pphoneNumber)de.knightsoftnet.validators.shared.data.ValueWithPos<String>formatE123NationalWithPos(ValueWithPosAndCountry<String> pphoneNumber)de.knightsoftnet.validators.shared.data.ValueWithPos<String>formatE123WithPos(ValueWithPosAndCountry<String> pphoneNumber)StringformatMs(String planguage, String pcountry, String pphoneNumber)de.knightsoftnet.validators.shared.data.ValueWithPos<String>formatMsWithPos(ValueWithPosAndCountry<String> pphoneNumber)StringformatRfc3966(String planguage, String pcountry, String pphoneNumber)de.knightsoftnet.validators.shared.data.ValueWithPos<String>formatRfc3966WithPos(ValueWithPosAndCountry<String> pphoneNumber)StringformatUrl(String planguage, String pcountry, String pphoneNumber)de.knightsoftnet.validators.shared.data.ValueWithPos<String>formatUrlWithPos(ValueWithPosAndCountry<String> pphoneNumber)Map<String,de.knightsoftnet.validators.shared.data.PhoneCountryData>getPhoneCountryConstants(String planguage)return phone country constants.List<de.knightsoftnet.validators.shared.data.PhoneNumberData>getSuggestions(String planguage, String psearch, int plimit)PhoneNumberDataWithFormatsparseAndFormatPhoneNumber(String planguage, String pcountry, String pphoneNumber)parse and reformat the phone number in all available formats.de.knightsoftnet.validators.shared.data.ValueWithPos<de.knightsoftnet.validators.shared.data.PhoneNumberData>parsePhoneNumber(ValueWithPosAndCountry<String> pphoneNumber)de.knightsoftnet.validators.shared.data.PhoneNumberDataparsePhoneNumber(String planguage, String pcountry, String pphoneNumber)Booleanvalidate(String pcountry, String pphoneNumber, Boolean pdin5008, Boolean pe123, Boolean puri, Boolean pms, Boolean pcommon)validate a phone number.
-
-
-
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 usepcountry- default countrypphoneNumber- 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 countrypphoneNumber- phone number to checkpdin5008- set to true if DIN 5008 format is allowedpe123- set to true if E123 format is allowedpuri- set to true if URI format is allowedpms- set to true if Microsoft format is allowedpcommon- set to true if common format is allowed- Returns:
- true if number is valid
-
-