/* * Jitsi, the OpenSource Java VoIP and Instant Messaging client. * * Copyright @ 2015 Atlassian Pty Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package net.java.sip.communicator.service.protocol; /** * Implements PhoneNumberI18nService which aids the parsing, formatting * and validating of international phone numbers. * * @author Lyubomir Marinov * @author Vincent Lucas * @author Damian Minkov */ public interface PhoneNumberI18nService { /** * Normalizes a String which may be a phone number or a identifier * by removing useless characters and, if necessary, replacing the alpahe * characters in corresponding dial pad numbers. * * @param possibleNumber a String which may represents a phone * number or an identifier to normalize. * * @return a String which is a normalized form of the specified * possibleNumber. */ public String normalize(String possibleNumber); /** * Tries to format the passed phone number into the international format. If * parsing fails or the string is not recognized as a valid phone number, * the input is returned as is. * * @param phoneNumber The phone number to format. * @return the formatted phone number in the international format. */ public String formatForDisplay(String phoneNumber); /** * Determines whether two String phone numbers match. * * @param aPhoneNumber a String which represents a phone number to * match to bPhoneNumber * @param bPhoneNumber a String which represents a phone number to * match to aPhoneNumber * @return true if the specified Strings match as phone * numbers; otherwise, false */ public boolean phoneNumbersMatch(String aPhoneNumber, String bPhoneNumber); /** * Indicates if the given string is possibly a phone number. * * @param possibleNumber the string to be verified * @return true if the possibleNumber is a phone number, * false - otherwise */ public boolean isPhoneNumber(String possibleNumber); }