package com.realnet.testdata.Services;
import java.util.*;
import com.realnet.testdata.Repository.StateRepository;
import com.realnet.testdata.Entity.State;

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

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

@Service
 public class State_ListFilter1Service {
@Autowired
private StateRepository Repository;




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

				if (isactive) {String Country_name = data.getCountry_name();
 System.out.println(Country_name + "\n");

			if ("item".equals(Country_name)){	
State_ListFilter1 dummy = new State_ListFilter1();
			dummy.setId(data.getId());
  dummy.setState_name(data.getState_name());
	l.add(dummy);
}} 
} 		
return l;}



 public   List<State_ListFilter1>   getlistbuilderparam(  String item) {
	List<State> list= Repository.findAll();
		ArrayList<State_ListFilter1> l = new ArrayList<>();
		for (State data : list) {
boolean isactive = data.isActive();

				if (isactive) {String Country_name = data.getCountry_name();
 System.out.println(Country_name + "\n");

			if (item.equals(Country_name)){	
State_ListFilter1 dummy = new State_ListFilter1();
			dummy.setId(data.getId());
  dummy.setState_name(data.getState_name());
	l.add(dummy);
}} 
} 		
return l;}
}