]> sjero.net Git - linphone/blob - java/common/org/linphone/core/LinphoneAddress.java
javadoc enhancements
[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          * Domain name
43          * @return null if not set
44          */
45         public String getDomain();
46         /**
47          * Port as String
48          * @return null if not set
49          */
50         public String getPort();
51         /**
52          * Port as integer value. 
53          * @return negative value if not set if not set
54          */
55         public int getPortInt();
56         /**
57          * set display name 
58          * @param name
59          */
60         public void setDisplayName(String name);
61         /**
62          * set user name 
63          * @param username
64          */
65         public void setUserName(String username);
66         /**
67          * set domain name 
68          * @param domain
69          */
70         public void setDomain(String domain);
71         /**
72          * set port as String 
73          * @param port, null if not set
74          */
75         public void setPort(String port);
76         /**
77          * set port as int 
78          * @param port, negative value if not set
79          */
80         public void setPortInt(int port);
81         /**
82          * Removes address's tags and uri headers so that it is displayable to the user.
83         **/
84         public void clean();
85         
86         /**
87          * 
88          * @return the address as a string.
89          */
90         public String asString();
91         /**
92          * 
93          * @return the address without display name as a string.
94          */
95         public String asStringUriOnly();
96         
97         /**
98          * same as {@link #asString()}
99          * 
100          * */
101         public String toString();
102 }