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

org.whispersystems.textsecure.api.push.exceptions.EncapsulatedExceptions Maven / Gradle / Ivy

There is a newer version: 1.8.7
Show newest version
/**
 * Copyright (C) 2014 Open Whisper Systems
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see .
 */
package org.whispersystems.textsecure.api.push.exceptions;

import org.whispersystems.textsecure.api.crypto.UntrustedIdentityException;

import java.util.LinkedList;
import java.util.List;

public class EncapsulatedExceptions extends Throwable {

  private final List untrustedIdentityExceptions;
  private final List  unregisteredUserExceptions;
  private final List    networkExceptions;

  public EncapsulatedExceptions(List untrustedIdentities,
                                List unregisteredUsers,
                                List networkExceptions)
  {
    this.untrustedIdentityExceptions = untrustedIdentities;
    this.unregisteredUserExceptions  = unregisteredUsers;
    this.networkExceptions           = networkExceptions;
  }

  public EncapsulatedExceptions(UntrustedIdentityException e) {
    this.untrustedIdentityExceptions = new LinkedList<>();
    this.unregisteredUserExceptions  = new LinkedList<>();
    this.networkExceptions           = new LinkedList<>();

    this.untrustedIdentityExceptions.add(e);
  }

  public List getUntrustedIdentityExceptions() {
    return untrustedIdentityExceptions;
  }

  public List getUnregisteredUserExceptions() {
    return unregisteredUserExceptions;
  }

  public List getNetworkExceptions() {
    return networkExceptions;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy