Interface CredentialDataResult.Entries

  • Enclosing class:
    CredentialDataResult

    public static interface CredentialDataResult.Entries
    A class for representing data elements returned.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      byte[] getEntry​(java.lang.String namespaceName, java.lang.String name)
      Gets the raw CBOR data for the value of an entry.
      boolean getEntryBoolean​(java.lang.String namespaceName, java.lang.String name)
      Gets the value of an entry.
      byte[] getEntryBytestring​(java.lang.String namespaceName, java.lang.String name)
      Gets the value of an entry.
      android.icu.util.Calendar getEntryCalendar​(java.lang.String namespaceName, java.lang.String name)
      Gets the value of an entry.
      long getEntryInteger​(java.lang.String namespaceName, java.lang.String name)
      Gets the value of an entry.
      java.util.Collection<java.lang.String> getEntryNames​(java.lang.String namespaceName)
      Get the names of all requested entries in a name space.
      java.lang.String getEntryString​(java.lang.String namespaceName, java.lang.String name)
      Gets the value of an entry.
      java.util.Collection<java.lang.String> getNamespaces()
      Gets the names of namespaces with retrieved entries.
      java.util.Collection<java.lang.String> getRetrievedEntryNames​(java.lang.String namespaceName)
      Get the names of all entries that were successfully retrieved from a name space.
      int getStatus​(java.lang.String namespaceName, java.lang.String name)
      Gets the status of an entry.
      boolean isUserAuthenticationNeeded()
      Helper to determine if at least one if the requested entries returned the STATUS_USER_AUTHENTICATION_FAILED status.
    • Field Detail

      • STATUS_OK

        static final int STATUS_OK
        Value was successfully retrieved.
        See Also:
        Constant Field Values
      • STATUS_NO_SUCH_ENTRY

        static final int STATUS_NO_SUCH_ENTRY
        The entry does not exist.
        See Also:
        Constant Field Values
      • STATUS_NOT_REQUESTED

        static final int STATUS_NOT_REQUESTED
        The entry was not requested.
        See Also:
        Constant Field Values
      • STATUS_NOT_IN_REQUEST_MESSAGE

        static final int STATUS_NOT_IN_REQUEST_MESSAGE
        The entry wasn't in the request message.
        See Also:
        Constant Field Values
      • STATUS_USER_AUTHENTICATION_FAILED

        static final int STATUS_USER_AUTHENTICATION_FAILED
        The entry was not retrieved because user authentication failed.
        See Also:
        Constant Field Values
      • STATUS_READER_AUTHENTICATION_FAILED

        static final int STATUS_READER_AUTHENTICATION_FAILED
        The entry was not retrieved because reader authentication failed.
        See Also:
        Constant Field Values
      • STATUS_NO_ACCESS_CONTROL_PROFILES

        static final int STATUS_NO_ACCESS_CONTROL_PROFILES
        The entry was not retrieved because it was configured without any access control profile.
        See Also:
        Constant Field Values
      • STATUS_UNKNOWN

        static final int STATUS_UNKNOWN
        The entry was not retrieved and the reason is not known.
        See Also:
        Constant Field Values
    • Method Detail

      • getNamespaces

        @NonNull
        java.util.Collection<java.lang.String> getNamespaces()
        Gets the names of namespaces with retrieved entries.
        Returns:
        collection of name of namespaces containing retrieved entries. May be empty if no data was retrieved.
      • getEntryNames

        @NonNull
        java.util.Collection<java.lang.String> getEntryNames​(@NonNull
                                                             java.lang.String namespaceName)
        Get the names of all requested entries in a name space.

        This includes the name of entries that weren't successfully retrieved. It is an error to call this with a namespace not returned in getNamespaces().

        Parameters:
        namespaceName - the namespace name to get entries for.
        Returns:
        A collection of names for the given namespace.
      • getRetrievedEntryNames

        @NonNull
        java.util.Collection<java.lang.String> getRetrievedEntryNames​(@NonNull
                                                                      java.lang.String namespaceName)
        Get the names of all entries that were successfully retrieved from a name space.

        This only returns entries for which getStatus(String, String) will return STATUS_OK. It is an error to call this with a namespace not returned in getNamespaces().

        Parameters:
        namespaceName - the namespace name to get entries for.
        Returns:
        The entries in the given namespace that were successfully rerieved.
        Throws:
        java.lang.IllegalArgumentException - if called with a name space not returned in getNamespaces().
      • getStatus

        int getStatus​(@NonNull
                      java.lang.String namespaceName,
                      @NonNull
                      java.lang.String name)
        Gets the status of an entry.

        This returns one of

        Parameters:
        namespaceName - the namespace name of the entry.
        name - the name of the entry to get the value for.
        Returns:
        the status indicating whether the value was retrieved and if not, why.
      • getEntry

        @Nullable
        byte[] getEntry​(@NonNull
                        java.lang.String namespaceName,
                        @NonNull
                        java.lang.String name)
        Gets the raw CBOR data for the value of an entry.

        This should only be called on an entry for which the getStatus(String, String) method returns STATUS_OK.

        Parameters:
        namespaceName - the namespace name of the entry.
        name - the name of the entry to get the value for.
        Returns:
        the raw CBOR data or null if no entry with the given name exists.
      • getEntryString

        @Nullable
        java.lang.String getEntryString​(@NonNull
                                        java.lang.String namespaceName,
                                        @NonNull
                                        java.lang.String name)
        Gets the value of an entry.

        This should only be called on an entry for which the getStatus(String, String) method returns STATUS_OK.

        Parameters:
        namespaceName - the namespace name of the entry.
        name - the name of the entry to get the value for.
        Returns:
        a String or null if no entry with the given name exists.
      • getEntryBytestring

        @Nullable
        byte[] getEntryBytestring​(@NonNull
                                  java.lang.String namespaceName,
                                  @NonNull
                                  java.lang.String name)
        Gets the value of an entry.

        This should only be called on an entry for which the getStatus(String, String) method returns STATUS_OK.

        Parameters:
        namespaceName - the namespace name of the entry.
        name - the name of the entry to get the value for.
        Returns:
        a byte[] or null if no entry with the given name exists.
      • getEntryInteger

        long getEntryInteger​(@NonNull
                             java.lang.String namespaceName,
                             @NonNull
                             java.lang.String name)
        Gets the value of an entry.

        This should only be called on an entry for which the getStatus(String, String) method returns STATUS_OK.

        Parameters:
        namespaceName - the namespace name of the entry.
        name - the name of the entry to get the value for.
        Returns:
        a long or 0 if no entry with the given name exists.
      • getEntryBoolean

        boolean getEntryBoolean​(@NonNull
                                java.lang.String namespaceName,
                                @NonNull
                                java.lang.String name)
        Gets the value of an entry.

        This should only be called on an entry for which the getStatus(String, String) method returns STATUS_OK.

        Parameters:
        namespaceName - the namespace name of the entry.
        name - the name of the entry to get the value for.
        Returns:
        a boolean or false if no entry with the given name exists.
      • getEntryCalendar

        @Nullable
        android.icu.util.Calendar getEntryCalendar​(@NonNull
                                                   java.lang.String namespaceName,
                                                   @NonNull
                                                   java.lang.String name)
        Gets the value of an entry.

        This should only be called on an entry for which the getStatus(String, String) method returns STATUS_OK.

        Parameters:
        namespaceName - the namespace name of the entry.
        name - the name of the entry to get the value for.
        Returns:
        a Calendar or null if no entry with the given name exists.
      • isUserAuthenticationNeeded

        boolean isUserAuthenticationNeeded()
        Helper to determine if at least one if the requested entries returned the STATUS_USER_AUTHENTICATION_FAILED status.
        Returns:
        true if at least one entry wasn't retrieved because user authentication was needed.