package me.thekey.android;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

import java.util.Collection;
import java.util.Date;

public interface Attributes {
    String ATTR_SSO_GUID = "ssoGuid";
    String ATTR_GR_MASTER_PERSON_ID = "grMasterPersonId";
    String ATTR_EMAIL = "email";
    String ATTR_FIRST_NAME = "firstName";
    String ATTR_LAST_NAME = "lastName";

    @Nullable
    String getUsername();

    @Nullable
    String getGuid();

    @NonNull
    Date getLoadedTime();

    boolean areValid();

    @NonNull
    Collection<String> getAttributeNames();

    @Nullable
    String getAttribute(@NonNull final String name);

    @Nullable
    default String getEmail() {
        return getAttribute(ATTR_EMAIL);
    }

    @Nullable
    default String getFirstName() {
        return getAttribute(ATTR_FIRST_NAME);
    }

    @Nullable
    default String getLastName() {
        return getAttribute(ATTR_LAST_NAME);
    }
}

@@ -107,16 +107,62 @@
 ullable;
+%0Aimport android.support.annotation.RestrictTo;
 %0A%0Aimport
@@ -208,16 +208,84 @@
 .Date;%0A%0A
+import static android.support.annotation.RestrictTo.Scope.LIBRARY;%0A%0A
 public i
@@ -518,16 +518,84 @@
 Name%22;%0A%0A
+    @RestrictTo(LIBRARY)%0A    long STALE_AGE = 24 * 60 * 60 * 1000;%0A%0A
     @Nul
@@ -673,24 +673,24 @@
    @NonNull%0A
-
     Date get
@@ -700,24 +700,153 @@
 dedTime();%0A%0A
+    default boolean areStale() %7B%0A        return getLoadedTime().before(new Date(System.currentTimeMillis() - STALE_AGE));%0A    %7D%0A%0A
     boolean 

add a method to check if attributes are stale