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