]> sjero.net Git - linphone/blob - java/common/org/linphone/core/LinphoneAddress.java
b2a2c938046801a094ecade7086fc4c877453d88
[linphone] / java / common / org / linphone / core / LinphoneAddress.java
1 /*
2 LinphoneAddress.java
3 Copyright (C) 2010  Belledonne Communications, Grenoble, France
4
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.
9
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.
14
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.
18 */
19 package org.linphone.core;
20 /**
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
28  *
29  */
30 public interface LinphoneAddress {
31         /**
32          * Human display name
33          * @return null if not set
34          */
35         public String getDisplayName();
36         /**
37          * userinfo 
38          * @return null if not set
39          */
40         public String getUserName();
41         /**
42          * 
43          * @return null if not set
44          */
45         public String getDomain();
46         public String getPort();
47         public int getPortInt();
48         /**
49          * set display name 
50          * @param name
51          */
52         public void setDisplayName(String name);
53         public void setUserName(String username);
54         public void setDomain(String domain);
55         public void setPort(String port);
56         public void setPortInt(int port);
57         public void clean();
58         
59         /**
60          * 
61          * @return the address as a string.
62          */
63         public String asString();
64         /**
65          * 
66          * @return the address without display name as a string.
67          */
68         public String asStringUriOnly();
69         
70         /**
71          * same as {@link #asString()}
72          * 
73          * */
74         public String toString();
75 }