package com.realnet.basicp1.Services;
import java.util.*;
import com.realnet.basicp1.Repository.CityRepository;
import com.realnet.basicp1.Entity.City;

import com.realnet.basicp1.Entity.City_ListFilter1;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
	import org.springframework.stereotype.Service;

@Service
 public class City_ListFilter1Service {
@Autowired
private CityRepository Repository;




 public   List<City_ListFilter1>   getlistbuilder() {
	List<City> list= Repository.findAll();
		ArrayList<City_ListFilter1> l = new ArrayList<>();
		for (City data : list) {
String Distric_name = data.getDistric_name();
 System.out.println(Distric_name + "\n");

			if ("item".equals(Distric_name)){	
City_ListFilter1 dummy = new City_ListFilter1();
			dummy.setId(data.getId());
  dummy.setCity_name(data.getCity_name());
	l.add(dummy);
} 
} 		
return l;}



 public   List<City_ListFilter1>   getlistbuilderparam(  String item) {
	List<City> list= Repository.findAll();
		ArrayList<City_ListFilter1> l = new ArrayList<>();
		for (City data : list) {
String Distric_name = data.getDistric_name();
 System.out.println(Distric_name + "\n");

			if (item.equals(Distric_name)){	
City_ListFilter1 dummy = new City_ListFilter1();
			dummy.setId(data.getId());
  dummy.setCity_name(data.getCity_name());
	l.add(dummy);
} 
} 		
return l;}
}