org.whispersystems.signalservice.api.util.CredentialsProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of signal-service-java Show documentation
Show all versions of signal-service-java Show documentation
Signal Service communication library for Java, unofficial fork
/**
* Copyright (C) 2014-2016 Open Whisper Systems
*
* Licensed according to the LICENSE file in this repository.
*/
package org.whispersystems.signalservice.api.util;
import org.whispersystems.signalservice.api.push.ServiceId.ACI;
import org.whispersystems.signalservice.api.push.ServiceId.PNI;
import org.whispersystems.signalservice.api.push.SignalServiceAddress;
public interface CredentialsProvider {
ACI getAci();
PNI getPni();
String getE164();
int getDeviceId();
String getPassword();
default String getUsername() {
StringBuilder sb = new StringBuilder();
sb.append(getAci().toString());
if (getDeviceId() != SignalServiceAddress.DEFAULT_DEVICE_ID) {
sb.append(".");
sb.append(getDeviceId());
}
return sb.toString();
}
}