public static List<Size> stringToList(String encodedSizes){
  String[] flatSizes=TextUtils.split(encodedSizes,LIST_DELIMITER);
  ArrayList<Size> list=new ArrayList<>();
  for (int i=0; i < flatSizes.length; i+=2) {
    int width=Integer.parseInt(flatSizes[i]);
    int height=Integer.parseInt(flatSizes[i + 1]);
    list.add(new Size(width,height));
  }
  return list;
}

public static List < Size > stringToList ( String encodedSizes ) { String [ ] flatSizes = TextUtils . split ( encodedSizes , LIST_DELIMITER ) ; ArrayList < Size > list = new ArrayList < > ( ) ; for ( int i = 0 ; i < flatSizes . length ; i += 2 ) { int width = Integer . parseInt ( flatSizes [ i ] ) ; int height = Integer . parseInt ( flatSizes [ i + 1 ] ) ; list . add ( new Size ( width , height ) ) ; } return list ; }
decode comma - separated even - length list of integers into a list of this class .
