本文整理汇总了Java中com.sun.deploy.util.StringUtils类的典型用法代码示例。如果您正苦于以下问题:Java StringUtils类的具体用法?Java StringUtils怎么用?Java StringUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StringUtils类属于com.sun.deploy.util包,在下文中一共展示了StringUtils类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: Request
import com.sun.deploy.util.StringUtils; //导入依赖的package包/类
/**
* @param requestType Request type to receive a response.
* @param params The parameters in this query
* @param fields Optional - Used for more data
*/
Request(RequestType requestType, LinkedHashMap<RequestType.ParamType, String> params, List<String> fields) {
this.params = params;
this.fields = fields;
this.requestType = requestType;
/// Format: wow/...DIR...?locale
if (params.size() == 0) {
this.queryURL = WoWAPI.URL_PREFIX + requestType.getDir() + WoWAPI.get().getURLSuffix();
} else {
this.queryURL = WoWAPI.URL_PREFIX + requestType.getDir();
//Add Params
for (String value : params.values()) {
queryURL = queryURL.concat(value + "/");
}
queryURL = removeSlash(queryURL);
//Check Fields
if (fields.size() > 0) {
queryURL = queryURL.concat("?fields=" + StringUtils.join(fields, ",") + "&" + WoWAPI.get().getURLSuffix().substring(1));
} else {
queryURL = queryURL.concat(WoWAPI.get().getURLSuffix());
}
}
}
开发者ID:M-AJ,项目名称:WowAPI,代码行数:29,代码来源:Request.java
示例2: generateFizzBuzz
import com.sun.deploy.util.StringUtils; //导入依赖的package包/类
public String generateFizzBuzz() {
List<String> result = new ArrayList<String>();
for (int i = 0; i < 3; i++) {
if ((i + 1) % 3 != 0 ) {
result.add(i, Integer.toString(i));
} else {
result.add(i, "Fizz");
}
}
return StringUtils.join(result, ",");
}
开发者ID:victorrentea,项目名称:training,代码行数:14,代码来源:FizzBuzz.java
示例3: addWords
import com.sun.deploy.util.StringUtils; //导入依赖的package包/类
private static void addWords(List items) {
words = new ArrayList<>();
for (Object item : items) {
String line = String.valueOf(item);
String[] newWords = StringUtils.splitString(line, ",\"");
Collections.addAll(words, newWords);
}
}
开发者ID:bruckhaus,项目名称:challenges,代码行数:9,代码来源:Words.java
示例4: runElection
import com.sun.deploy.util.StringUtils; //导入依赖的package包/类
private static void runElection(Scanner scanner) {
int numCandidates = scanner.nextInt();
scanner.nextLine(); //Eat a line ending
List<String> candidates = new ArrayList<>();
for (int i = 0; i < numCandidates; i++) {
candidates.add(StringUtils.trimWhitespace(scanner.nextLine()));
}
List<List<Integer>> votes = collectVotes(scanner);
List<Integer> winners = calculateResultsNaive(votes);
publishResults(candidates, winners);
}
开发者ID:aspanu,项目名称:SolutionsHackerRank,代码行数:15,代码来源:Solution_AustralianElections.java
示例5: getPrime
import com.sun.deploy.util.StringUtils; //导入依赖的package包/类
private long getPrime(String line) {
String[] fields = StringUtils.splitString(line, ", ");
return Long.parseLong(fields[1]);
}
开发者ID:bruckhaus,项目名称:challenges,代码行数:5,代码来源:Prime1stMillion.java
示例6: shouldGetResultForPerformCalabashAction
import com.sun.deploy.util.StringUtils; //导入依赖的package包/类
@Test
public void shouldGetResultForPerformCalabashAction() throws Exception {
String expectedActions = "backdoor\n" +
"clear_preferences\n" +
"click_on_screen\n" +
"double_tap_coordinate\n" +
"drag\n" +
"drag_coordinates\n" +
"dump_body_html\n" +
"dump_html\n" +
"enter_text_by_selector\n" +
"execute_async_javascript\n" +
"execute_javascript\n" +
"finish_opened_activities\n" +
"get_activity_name\n" +
"get_load_progress\n" +
"get_map_bounds\n" +
"get_map_center\n" +
"get_map_marker\n" +
"get_map_markers\n" +
"get_map_zoom\n" +
"get_preferences\n" +
"get_url\n" +
"go_back\n" +
"hide_soft_keyboard\n" +
"is_current_activity_focused\n" +
"keyboard_enter_text\n" +
"list_actions\n" +
"long_press_coordinate\n" +
"nullAction\n" +
"pan_map_to\n" +
"press_key\n" +
"press_l10n_element\n" +
"press_menu\n" +
"press_user_action_button\n" +
"scroll_to\n" +
"send_key_down\n" +
"send_key_enter\n" +
"send_key_left\n" +
"send_key_right\n" +
"send_key_up\n" +
"set_activity_orientation\n" +
"set_gps_coordinates\n" +
"set_map_center\n" +
"set_map_zoom\n" +
"set_preferences\n" +
"set_property_by_css_selector\n" +
"swipe\n" +
"tap_map_away_from_markers\n" +
"tap_map_marker_by_title\n" +
"touch_coordinate\n" +
"version\n" +
"wait_for_l10n_element";
TestUtils.goToActivity(application, TestUtils.ACTIVITY_SCROLL_LIST);
ActionResult result = application.performCalabashAction("list_actions");
List<String> actions = result.getBonusInformation();
Collections.sort(actions);
String actualActions = StringUtils.join(actions, "\n");
assertEquals(expectedActions, actualActions);
assertEquals("Available actions", result.getMessage());
assertEquals(true, result.isSuccess());
}
开发者ID:vishnukarthikl,项目名称:calabash-android-java,代码行数:65,代码来源:AllActionsIT.java
注:本文中的com.sun.deploy.util.StringUtils类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论