PLANATRONICS Posted September 16, 2015 Report Posted September 16, 2015 String string = searchText + "/" + tags + "/" + category + "/" + workflowStatus + "/" + sortBy + "/" + sortType + "/" + maxResults + "/" + pageIndex; String id = null; painavi anni string values eeee... naakunna scenario enti antey id only non null values eee add cheyyali...... string ni split chesa delimeter basis meedha.... kind of struck here
TOM_BHAYYA Posted September 16, 2015 Report Posted September 16, 2015 Kochhen naake artham avvaledha evvariki artham avvaledha
PLANATRONICS Posted September 16, 2015 Author Report Posted September 16, 2015 String string = searchText + "/" + tags + "/" + category + "/" + workflowStatus + "/" + sortBy + "/" + sortType + "/" + maxResults + "/" + pageIndex; dheenilo unna prathidhi String value like searchText, tags etc .... anni... on the fly ee string ni read chesi dheenilo unna null values consider cheyyakunda only non null values eee theesukoni String ni form cheyyali
TOM_BHAYYA Posted September 16, 2015 Report Posted September 16, 2015 String string = searchText + "/" + tags + "/" + category + "/" + workflowStatus + "/" + sortBy + "/" + sortType + "/" + maxResults + "/" + pageIndex; dheenilo unna prathidhi String value like searchText, tags etc .... anni... on the fly ee string ni read chesi dheenilo unna null values consider cheyyakunda only non null values eee theesukoni String ni form cheyyali Idhoka kind of answer ekkuva think cheyale.. String string = StringUtils.isNotEmpty(searchText)?(searchText + "/") : null ; Itla verevi b add chey
PLANATRONICS Posted September 16, 2015 Author Report Posted September 16, 2015 Idhoka kind of answer ekkuva think cheyale.. String string = StringUtils.isNotEmpty(searchText)?(searchText + "/") : null ; Itla verevi b add chey ardgam avvaledhu uncle
PLANATRONICS Posted September 16, 2015 Author Report Posted September 16, 2015 public static void main(String[] args) { String searchText = "Crisp"; String tags = "region_al, topic_dhtcc"; String category = "0"; String workflowStatus =null; String sortBy = null; String sortType =null; String maxResults = "10"; String pageIndex = null; String string = searchText + "/" + tags + "/" + category + "/" + workflowStatus + "/" + sortBy + "/" + sortType + "/" + maxResults + "/" + pageIndex; String[] parts = string.split("/"); for(int i = 0 ; i <parts.length ; i++){ if(parts[i] != null && !parts[i].isEmpty()){ String value = parts[i]; System.out.println(value); } } } } idhi run chesthey ila vasthondhi answer Crisp region_al, topic_dhtcc 0 null null null 10 null null check chesthunna null values endhuku vasthunnayo ardham kavadam ledhu...
TOM_BHAYYA Posted September 16, 2015 Report Posted September 16, 2015 String string = searchText + "/" + tags + "/" + category + "/" + workflowStatus + "/" + sortBy + "/" + sortType + "/" + maxResults + "/" + pageIndex; dheenilo unna prathidhi String value like searchText, tags etc .... anni... on the fly ee string ni read chesi dheenilo unna null values consider cheyyakunda only non null values eee theesukoni String ni form cheyyali String string = StringUtils.isNotEmpty(searchText)?(searchText + "/") : null + StringUtils.isNotEmpty(tags)?( tags+ "/") : null + StringUtils.isNotEmpty(category)?(category + "/") : null + StringUtils.isNotEmpty(workflowStatus)?( workflowStatus+ "/") : null + StringUtils.isNotEmpty(sortBy)?(sortBy + "/") : null + StringUtils.isNotEmpty(pageIndex)?(pageIndex) : null ;
PLANATRONICS Posted September 16, 2015 Author Report Posted September 16, 2015 String string = StringUtils.isNotEmpty(searchText)?(searchText + "/") : null + StringUtils.isNotEmpty(tags)?( tags+ "/") : null + StringUtils.isNotEmpty(category)?(category + "/") : null + StringUtils.isNotEmpty(workflowStatus)?( workflowStatus+ "/") : null + StringUtils.isNotEmpty(sortBy)?(sortBy + "/") : null + StringUtils.isNotEmpty(pageIndex)?(pageIndex) : null ; - The operator + is undefined for the argument type(s) null, boolean Error uncle
TOM_BHAYYA Posted September 16, 2015 Report Posted September 16, 2015 - The operator + is undefined for the argument type(s) null, boolean Error unclebraces pettu null tharvatha
rrc_2015 Posted September 16, 2015 Report Posted September 16, 2015 use this System.out.println(value.length()) inside if condition ; You have to get null pointer exception .. if not then we are assuming wrong.
rrc_2015 Posted September 16, 2015 Report Posted September 16, 2015 use this System.out.println(value.length()) inside if condition ; You have to get null pointer exception .. if not then we are assuming wrong. this is just to make sure you are not printing "null" string.
PLANATRONICS Posted September 16, 2015 Author Report Posted September 16, 2015 braces pettu null tharvatha still error bhayya Multiple markers at this line - The operator + is undefined for the argument type(s) null, boolean - Syntax error on token "}", assert expected after this token - The operator + is undefined for the argument type(s) null, boolean - Syntax error, insert ";" to complete LocalVariableDeclarationStatement - The operator + is undefined for the argument type(s) null, boolean - The operator + is undefined for the argument type(s) boolean - The operator + is undefined for the argument type(s) null, boolean
PLANATRONICS Posted September 16, 2015 Author Report Posted September 16, 2015 use this System.out.println(value.length()) inside if condition ; You have to get null pointer exception .. if not then we are assuming wrong. lenghth by some how 1 vasthondhi bhayya/..... tried that option already
Recommended Posts