Jump to content

Java Help


Recommended Posts

Posted

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

Posted

Kochhen naake artham avvaledha evvariki artham avvaledha

Posted

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

Posted

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
Posted

Idhoka kind of answer ekkuva think cheyale..

String string = StringUtils.isNotEmpty(searchText)?(searchText + "/") : null ;

Itla verevi b add chey

 

ardgam avvaledhu uncle

Posted

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...

Posted

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 ;
Posted

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

Posted

- The operator + is undefined for the argument type(s) null,
boolean





Error uncle

braces pettu null tharvatha
Posted

use this System.out.println(value.length()) inside if condition ;

 

You have to get null pointer exception .. if not then we are assuming wrong.

Posted

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.
 

Posted

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

Posted

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

×
×
  • Create New...