package com.realnet.basicp1.Services;
import java.util.*;
import com.realnet.basicp1.Repository.TypesRepository;
import com.realnet.basicp1.Entity.Types;

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

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

@Service
 public class Types_ListFilter1Service {
@Autowired
private TypesRepository Repository;




 public   List<Types_ListFilter1>   getlistbuilder() {
	List<Types> list= Repository.findAll();
		ArrayList<Types_ListFilter1> l = new ArrayList<>();
		for (Types data : list) {
String Manufacturer = data.getManufacturer();
 System.out.println(Manufacturer + "\n");

			if ("item".equals(Manufacturer)){	
Types_ListFilter1 dummy = new Types_ListFilter1();
			dummy.setId(data.getId());
  dummy.setType_name(data.getType_name());
	l.add(dummy);
} 
} 		
return l;}



 public   List<Types_ListFilter1>   getlistbuilderparam(  String item) {
	List<Types> list= Repository.findAll();
		ArrayList<Types_ListFilter1> l = new ArrayList<>();
		for (Types data : list) {
String Manufacturer = data.getManufacturer();
 System.out.println(Manufacturer + "\n");

			if (item.equals(Manufacturer)){	
Types_ListFilter1 dummy = new Types_ListFilter1();
			dummy.setId(data.getId());
  dummy.setType_name(data.getType_name());
	l.add(dummy);
} 
} 		
return l;}
}