All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.whispersystems.signalservice.api.util.CredentialsProvider Maven / Gradle / Ivy

There is a newer version: 2.15.3_unofficial_107
Show newest version
/**
 * 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();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy