package com.realnet.basicp1.Services;
import java.util.*;
import com.realnet.basicp1.Repository.VillageRepository;
import com.realnet.basicp1.Entity.Village;

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

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

@Service
 public class Village_ListFilter1Service {
@Autowired
private VillageRepository Repository;




 public   List<Village_ListFilter1>   getlistbuilder() {
	List<Village> list= Repository.findAll();
		ArrayList<Village_ListFilter1> l = new ArrayList<>();
		for (Village data : list) {
String City_name = data.getCity_name();
 System.out.println(City_name + "\n");

			if ("item".equals(City_name)){	
Village_ListFilter1 dummy = new Village_ListFilter1();
			dummy.setId(data.getId());
  dummy.setVillage_name(data.getVillage_name());
	l.add(dummy);
} 
} 		
return l;}



 public   List<Village_ListFilter1>   getlistbuilderparam(  String item) {
	List<Village> list= Repository.findAll();
		ArrayList<Village_ListFilter1> l = new ArrayList<>();
		for (Village data : list) {
String City_name = data.getCity_name();
 System.out.println(City_name + "\n");

			if (item.equals(City_name)){	
Village_ListFilter1 dummy = new Village_ListFilter1();
			dummy.setId(data.getId());
  dummy.setVillage_name(data.getVillage_name());
	l.add(dummy);
} 
} 		
return l;}
}