@Test public void testCreateUri() throws Exception { String result = Format.createUri(true,"uid","pubkey","currency"); Assert.assertTrue(result.equals("pubkey")); result = Format.createUri(false,"uid","pubkey","currency"); Assert.assertTrue(result.equals("duniter: }
public static String createUri(boolean simple, String uid, String publicKey, String currency) { String result; if(simple){ result = publicKey; }else { result = Contantes.CONTACT_PATH; if (uid.isEmpty() || uid.equals(" ")) { result = result.concat(Contantes.SEPARATOR1); } else { result = result.concat(uid).concat(Contantes.SEPARATOR1); } if (publicKey.isEmpty() || publicKey.equals(" ")) { result = result.concat(Contantes.SEPARATOR2); } else { result = result.concat(publicKey).concat(Contantes.SEPARATOR2); } if (!currency.isEmpty() && !currency.equals(" ")) { result = result.concat(currency); } } return result; }
Format { public static String createUri(boolean simple, String uid, String publicKey, String currency) { String result; if(simple){ result = publicKey; }else { result = Contantes.CONTACT_PATH; if (uid.isEmpty() || uid.equals(" ")) { result = result.concat(Contantes.SEPARATOR1); } else { result = result.concat(uid).concat(Contantes.SEPARATOR1); } if (publicKey.isEmpty() || publicKey.equals(" ")) { result = result.concat(Contantes.SEPARATOR2); } else { result = result.concat(publicKey).concat(Contantes.SEPARATOR2); } if (!currency.isEmpty() && !currency.equals(" ")) { result = result.concat(currency); } } return result; } }
Format { public static String createUri(boolean simple, String uid, String publicKey, String currency) { String result; if(simple){ result = publicKey; }else { result = Contantes.CONTACT_PATH; if (uid.isEmpty() || uid.equals(" ")) { result = result.concat(Contantes.SEPARATOR1); } else { result = result.concat(uid).concat(Contantes.SEPARATOR1); } if (publicKey.isEmpty() || publicKey.equals(" ")) { result = result.concat(Contantes.SEPARATOR2); } else { result = result.concat(publicKey).concat(Contantes.SEPARATOR2); } if (!currency.isEmpty() && !currency.equals(" ")) { result = result.concat(currency); } } return result; }  }
Format { public static String createUri(boolean simple, String uid, String publicKey, String currency) { String result; if(simple){ result = publicKey; }else { result = Contantes.CONTACT_PATH; if (uid.isEmpty() || uid.equals(" ")) { result = result.concat(Contantes.SEPARATOR1); } else { result = result.concat(uid).concat(Contantes.SEPARATOR1); } if (publicKey.isEmpty() || publicKey.equals(" ")) { result = result.concat(Contantes.SEPARATOR2); } else { result = result.concat(publicKey).concat(Contantes.SEPARATOR2); } if (!currency.isEmpty() && !currency.equals(" ")) { result = result.concat(currency); } } return result; }  static void initUnit(Context context, TextView textView, long quantitatif, int base, long delay, long dividend, int baseDividend, boolean isFirstAmount, String currencyName); static long convertBase(long value, int base, int newBase); static String minifyPubkey(String pubkey); static String createUri(boolean simple, String uid, String publicKey, String currency); static Map<String, String> parseUri(String uri); static String isNull(String txt); }
Format { public static String createUri(boolean simple, String uid, String publicKey, String currency) { String result; if(simple){ result = publicKey; }else { result = Contantes.CONTACT_PATH; if (uid.isEmpty() || uid.equals(" ")) { result = result.concat(Contantes.SEPARATOR1); } else { result = result.concat(uid).concat(Contantes.SEPARATOR1); } if (publicKey.isEmpty() || publicKey.equals(" ")) { result = result.concat(Contantes.SEPARATOR2); } else { result = result.concat(publicKey).concat(Contantes.SEPARATOR2); } if (!currency.isEmpty() && !currency.equals(" ")) { result = result.concat(currency); } } return result; }  static void initUnit(Context context, TextView textView, long quantitatif, int base, long delay, long dividend, int baseDividend, boolean isFirstAmount, String currencyName); static long convertBase(long value, int base, int newBase); static String minifyPubkey(String pubkey); static String createUri(boolean simple, String uid, String publicKey, String currency); static Map<String, String> parseUri(String uri); static String isNull(String txt); static final boolean SIMPLE; static final boolean LONG; }