com.kii.cloud.filesync
Class Account

java.lang.Object
  extended by com.kii.cloud.filesync.Account

public final class Account
extends java.lang.Object

Account object.


Nested Class Summary
static class Account.Type
          Account type enum values.
 
Field Summary
static java.lang.String PHONE_LABEL
           
 
Constructor Summary
Account(Account.Type type, java.lang.String rawId, java.lang.String password)
          Create account object with specified parameters.
 
Method Summary
static Account fromLocalPhone(java.lang.String countryCode, java.lang.String phoneNumber, java.lang.String password)
          Create an account object based on local phone number.
static Account fromString(java.lang.String userId, java.lang.String password)
          Create an account object.
 java.lang.String getPassword()
          Get password for the account.
 java.lang.String getRawId()
          Get account's raw ID.
 Account.Type getType()
          Get account type.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PHONE_LABEL

public static final java.lang.String PHONE_LABEL
See Also:
Constant Field Values
Constructor Detail

Account

public Account(Account.Type type,
               java.lang.String rawId,
               java.lang.String password)
Create account object with specified parameters.

Method Detail

fromLocalPhone

public static Account fromLocalPhone(java.lang.String countryCode,
                                     java.lang.String phoneNumber,
                                     java.lang.String password)
                              throws java.lang.IllegalArgumentException
Create an account object based on local phone number.

Parameters:
countryCode - Country code. (ex. "JP")
phoneNumber - Local phone number (ex. "09011111111");
password - Password.
Throws:
java.lang.IllegalArgumentException - Some problems in parameters.

fromString

public static Account fromString(java.lang.String userId,
                                 java.lang.String password)
                          throws java.lang.IllegalArgumentException
Create an account object. Account's type is estimated automatically, except for local phone without country code (ex. "09012345678"). Please see also #fromLocalPhone for local phone account type.

Parameters:
userId - One of email, phone number, Kii ID username
password - Password. Acceptable format of userId is:
  • foo@example.org (email)
  • +819012345678 (internatinal phone)
  • JP-09012345678 (local phone with country code prefixed)
  • 01234567-89ab-cdef-0123-456789abcdef (KiiCloud's username)
Throws:
java.lang.IllegalArgumentException

getPassword

public java.lang.String getPassword()
Get password for the account.


getRawId

public java.lang.String getRawId()
Get account's raw ID.


getType

public Account.Type getType()
Get account type.