3 Copyright (C) 2010 Belledonne Communications, Grenoble, France
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 package org.linphone.core;
21 * Object that represents a SIP address.
22 * The LinphoneAddress is an opaque object to represents SIP addresses, ie the content of SIP's 'from' and 'to' headers.
23 * A SIP address is made of display name, username, domain name, port, and various uri headers (such as tags).
24 * It looks like 'Alice <sip:alice@example.net>'. The LinphoneAddress has methods to extract and manipulate all parts of the address.
25 * When some part of the address (for example the username) is empty, the accessor methods return null.
26 * <br> Can be instanciated using both {@link LinphoneCoreFactory#createLinphoneAddress(String, String, String)} or {@link LinphoneCoreFactory#createLinphoneAddress(String)}
27 * @author jehanmonnier
30 public interface LinphoneAddress {
33 * @return null if not set
35 public String getDisplayName();
38 * @return null if not set
40 public String getUserName();
43 * @return null if not set
45 public String getDomain();
48 * @return null if not set
50 public String getPort();
52 * Port as integer value.
53 * @return negative value if not set if not set
55 public int getPortInt();
60 public void setDisplayName(String name);
65 public void setUserName(String username);
70 public void setDomain(String domain);
73 * @param port, null if not set
75 public void setPort(String port);
78 * @param port, negative value if not set
80 public void setPortInt(int port);
82 * Removes address's tags and uri headers so that it is displayable to the user.
88 * @return the address as a string.
90 public String asString();
93 * @return the address without display name as a string.
95 public String asStringUriOnly();
98 * same as {@link #asString()}
101 public String toString();