@Test public void persist() { final Cognito cognito = new Cognito(TOKEN, IDENTITY_ID, EXPIRES_AT); localCognitoTokenStore.persist(cognito); assertEquals(cognito, localCognitoTokenStore.getCognitoToken()); localCognitoTokenStore.persist(null); assertEquals(null, localCognitoTokenStore.getCognitoToken()); }
public void persist(@Nullable Cognito cognito) { final SharedPreferences.Editor editor = sharedPreferences.get().edit(); editor.putString(KEY_COGNITO_TOKEN, cognito != null ? cognito.getCognitoToken() : null); editor.putString(KEY_COGNITO_IDENTITY_ID, cognito != null ? cognito.getIdentityId() : null); editor.putLong(KEY_COGNITO_TOKEN_EXPIRATION, cognito != null ? cognito.getCognitoTokenExpiresAt().getTime() : -1); editor.apply(); }
LocalCognitoTokenStore { public void persist(@Nullable Cognito cognito) { final SharedPreferences.Editor editor = sharedPreferences.get().edit(); editor.putString(KEY_COGNITO_TOKEN, cognito != null ? cognito.getCognitoToken() : null); editor.putString(KEY_COGNITO_IDENTITY_ID, cognito != null ? cognito.getIdentityId() : null); editor.putLong(KEY_COGNITO_TOKEN_EXPIRATION, cognito != null ? cognito.getCognitoTokenExpiresAt().getTime() : -1); editor.apply(); } }
LocalCognitoTokenStore { public void persist(@Nullable Cognito cognito) { final SharedPreferences.Editor editor = sharedPreferences.get().edit(); editor.putString(KEY_COGNITO_TOKEN, cognito != null ? cognito.getCognitoToken() : null); editor.putString(KEY_COGNITO_IDENTITY_ID, cognito != null ? cognito.getIdentityId() : null); editor.putLong(KEY_COGNITO_TOKEN_EXPIRATION, cognito != null ? cognito.getCognitoTokenExpiresAt().getTime() : -1); editor.apply(); } @Inject  LocalCognitoTokenStore(@NonNull Lazy<SharedPreferences> sharedPreferences); }
LocalCognitoTokenStore { public void persist(@Nullable Cognito cognito) { final SharedPreferences.Editor editor = sharedPreferences.get().edit(); editor.putString(KEY_COGNITO_TOKEN, cognito != null ? cognito.getCognitoToken() : null); editor.putString(KEY_COGNITO_IDENTITY_ID, cognito != null ? cognito.getIdentityId() : null); editor.putLong(KEY_COGNITO_TOKEN_EXPIRATION, cognito != null ? cognito.getCognitoTokenExpiresAt().getTime() : -1); editor.apply(); } @Inject  LocalCognitoTokenStore(@NonNull Lazy<SharedPreferences> sharedPreferences); @Nullable Cognito getCognitoToken(); void persist(@Nullable Cognito cognito); }
LocalCognitoTokenStore { public void persist(@Nullable Cognito cognito) { final SharedPreferences.Editor editor = sharedPreferences.get().edit(); editor.putString(KEY_COGNITO_TOKEN, cognito != null ? cognito.getCognitoToken() : null); editor.putString(KEY_COGNITO_IDENTITY_ID, cognito != null ? cognito.getIdentityId() : null); editor.putLong(KEY_COGNITO_TOKEN_EXPIRATION, cognito != null ? cognito.getCognitoTokenExpiresAt().getTime() : -1); editor.apply(); } @Inject  LocalCognitoTokenStore(@NonNull Lazy<SharedPreferences> sharedPreferences); @Nullable Cognito getCognitoToken(); void persist(@Nullable Cognito cognito);  }