package com.realnet.testdata.Services;
import java.util.*;
import com.realnet.testdata.Repository.CountryRepository;
import com.realnet.testdata.Entity.Country;

import com.realnet.testdata.Entity.Country_ListFilter1;
import java.util.List;

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

@Service
 public class Country_ListFilter1Service {
@Autowired
private CountryRepository Repository;




 public   List<Country_ListFilter1>   getlistbuilder() {
	List<Country> list= Repository.findAll();
		ArrayList<Country_ListFilter1> l = new ArrayList<>();
		for (Country data : list) {
boolean isactive = data.isActive();

				if (isactive) {{	
Country_ListFilter1 dummy = new Country_ListFilter1();
			dummy.setId(data.getId());
  dummy.setName(data.getName());
	l.add(dummy);
}} 
} 		
return l;}



 public   List<Country_ListFilter1>   getlistbuilderparam( ) {
	List<Country> list= Repository.findAll();
		ArrayList<Country_ListFilter1> l = new ArrayList<>();
		for (Country data : list) {
boolean isactive = data.isActive();

				if (isactive) {{	
Country_ListFilter1 dummy = new Country_ListFilter1();
			dummy.setId(data.getId());
  dummy.setName(data.getName());
	l.add(dummy);
}} 
} 		
return l;}
}