list - Java Comparator removing values form String object -


i trying sort list using java comparator reference https://www.soapui.org/apidocs/net/java/dev/wadl/x2009/x02/resourcedocument.resource.html

import java.util.comparator; import net.java.dev.wadl.x2009.x02.resourcedocument.resource; public class resourcecomparator implements comparator<resource>{     @override     public int compare(resource o1, resource o2) {         return o1.getpath().compareto(o2.getpath());     }    } 

but getting wrong values , path has below values

before sorting:

/customer,/customer/{id},/order/{id},/order 

after sorting:

/customer,/customer/{id},/order,/order 

i not sure why "{id}" missing after sort.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -