mobile/android/base/fxa/login/FxAccountLoginTransition.java

Wed, 31 Dec 2014 07:22:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:22:50 +0100
branch
TOR_BUG_3246
changeset 4
fc2d59ddac77
permissions
-rw-r--r--

Correct previous dual key logic pending first delivery installment.

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 package org.mozilla.gecko.fxa.login;
     8 public class FxAccountLoginTransition {
     9   public interface Transition {
    10   }
    12   public static class LogMessage implements Transition {
    13     public final String detailMessage;
    15     public LogMessage(String detailMessage) {
    16       this.detailMessage = detailMessage;
    17     }
    19     @Override
    20     public String toString() {
    21       return getClass().getSimpleName() + (this.detailMessage == null ? "" : "('" + this.detailMessage + "')");
    22     }
    23   }
    25   public static class AccountNeedsVerification extends LogMessage {
    26     public AccountNeedsVerification() {
    27       super(null);
    28     }
    29   }
    31   public static class AccountVerified extends LogMessage {
    32     public AccountVerified() {
    33       super(null);
    34     }
    35   }
    37   public static class PasswordRequired extends LogMessage {
    38     public PasswordRequired() {
    39       super(null);
    40     }
    41   }
    43   public static class LocalError implements Transition {
    44     public final Exception e;
    46     public LocalError(Exception e) {
    47       this.e = e;
    48     }
    50     @Override
    51     public String toString() {
    52       return "Log(" + this.e + ")";
    53     }
    54   }
    56   public static class RemoteError implements Transition {
    57     public final Exception e;
    59     public RemoteError(Exception e) {
    60       this.e = e;
    61     }
    63     @Override
    64     public String toString() {
    65       return "Log(" + (this.e == null ? "null" : this.e) + ")";
    66     }
    67   }
    68 }

mercurial