More builder-like interface for LinphoneProxyConfig

This commit is contained in:
Guillaume Beraudo 2014-02-12 14:11:12 +01:00
parent eab65df8f3
commit 8367c0fef2
2 changed files with 6 additions and 5 deletions

View file

@ -30,7 +30,7 @@ public interface LinphoneProxyConfig {
*Because proxy configuration must be consistent, applications MUST call {@link #edit()} before doing any attempts to modify proxy configuration (such as identity, proxy address and so on).
*Once the modifications are done, then the application must call {@link #done()} to commit the changes.
*/
public void edit();
public LinphoneProxyConfig edit();
/**
* Commits modification made to the proxy configuration.
*/
@ -65,9 +65,8 @@ public interface LinphoneProxyConfig {
* Enable register for this proxy config.
* Register message is issued after call to {@link #done()}
* @param value
* @throws LinphoneCoreException
*/
public void enableRegister(boolean value) throws LinphoneCoreException;
public LinphoneProxyConfig enableRegister(boolean value);
/**
* @return true if registration to the proxy is enabled.
*/

View file

@ -84,16 +84,18 @@ class LinphoneProxyConfigImpl implements LinphoneProxyConfig {
private native int lookupCCCFromIso(long nativePtr, String iso);
private native int lookupCCCFromE164(long nativePtr, String e164);
public void enableRegister(boolean value) {
public LinphoneProxyConfig enableRegister(boolean value) {
enableRegister(nativePtr,value);
return this;
}
public void done() {
done(nativePtr);
}
public void edit() {
public LinphoneProxyConfig edit() {
edit(nativePtr);
return this;
}
public void setIdentity(String identity) throws LinphoneCoreException {