projects/account_manager/src/main/java/io/v/android/apps/account_manager/CertificateDisplayActivity.java
/**
     * Returns a human-readable description of a caveat.
     *
     * @param caveat        the caveat to be examined
     * @return              a human-readable description of the caveat
     */
Returns a human-readable description of a caveat.
@param caveat        the caveat to be examined
@return              a human-readable description of the caveat
Returns a human - readable description of a caveat . @param caveat the caveat to be examined @return a human - readable description of the caveat
public static String caveatText(Caveat caveat) {
        Id caveatId = caveat.getId();
        if (caveatId.equals(Constants.CONST_CAVEAT.getId())) {
            return "Const Caveat";
        } else if (caveatId.equals(Constants.EXPIRY_CAVEAT.getId())) {
            String ret = "Expiry Caveat: ";
            try {
                DateTime expiry = expiryCaveatPayload(caveat);
                ret += expiry.toString(DateTimeFormat.mediumDateTime());
            } catch (VException e) {
                android.util.Log.e(TAG, "Error parsing expiry caveat payload: " + e);
                ret += "Could not get expiry time";
            }
            return ret;
        } else if (caveatId.equals(Constants.METHOD_CAVEAT.getId())) {
            String ret = "Method Caveat: ";
            try {
                List<String> methods = methodCaveatPayload(caveat);
                for (String name: methods) {
                    ret += name + "\n";
                }
            } catch (VException e) {
                android.util.Log.e(TAG, "Error parsing method caveat payload: " + e);
                ret += "Could not get method names";
            }
            return ret;
        } else if (caveatId.equals(Constants.PEER_BLESSINGS_CAVEAT.getId())) {
            return  "Peer Blessings Caveat";
        } else if (caveatId.equals(Constants.PUBLIC_KEY_THIRD_PARTY_CAVEAT.getId())) {
            return  "Public Key Third Party Caveat";
        } else {
            return  "Unknown Caveat";
        }
    }
public static String caveatText ( Caveat caveat ) { Id caveatId = caveat . getId ( ) ; if ( caveatId . equals ( Constants . CONST_CAVEAT . getId ( ) ) ) { return "Const Caveat" ; } else if ( caveatId . equals ( Constants . EXPIRY_CAVEAT . getId ( ) ) ) { String ret = "Expiry Caveat: " ; try { DateTime expiry = expiryCaveatPayload ( caveat ) ; ret += expiry . toString ( DateTimeFormat . mediumDateTime ( ) ) ; } catch ( VException e ) { android . util . Log . e ( TAG , "Error parsing expiry caveat payload: " + e ) ; ret += "Could not get expiry time" ; } return ret ; } else if ( caveatId . equals ( Constants . METHOD_CAVEAT . getId ( ) ) ) { String ret = "Method Caveat: " ; try { List < String > methods = methodCaveatPayload ( caveat ) ; for ( String name : methods ) { ret += name + "\n" ; } } catch ( VException e ) { android . util . Log . e ( TAG , "Error parsing method caveat payload: " + e ) ; ret += "Could not get method names" ; } return ret ; } else if ( caveatId . equals ( Constants . PEER_BLESSINGS_CAVEAT . getId ( ) ) ) { return "Peer Blessings Caveat" ; } else if ( caveatId . equals ( Constants . PUBLIC_KEY_THIRD_PARTY_CAVEAT . getId ( ) ) ) { return "Public Key Third Party Caveat" ; } else { return "Unknown Caveat" ; } }
Returns a human-readable description of a caveat.
Returns a human - readable description of a caveat .