class TargetTypesServiceImpl implements TargetTypesService {

	@Override
	public List<TargetTypeAttribute> getTargetTypeAttributes(final List<TargetTypes> targetTypes) {
		List<TargetTypeAttribute> attributes = Lists.newArrayList();
		for (TargetTypes targetType : targetTypes) {
			String targetName = targetType.getTargetName().trim();
			String dataSourceName = targetType.getDataSourceName().trim();
			TargetTypeAttribute targetTypeAttribute = new TargetTypeAttribute();
			targetTypeAttribute.setAttributes(Lists.newArrayList());
			targetTypeAttribute.setTargetName(targetType.getTargetName().trim());
			targetTypeAttribute.setAllAttributesName(getFieldNames(dataSourceName + "_" + targetName, targetName));
			targetTypeAttribute.setIncludeAll(false);
			targetTypeAttribute.setIndex("/"+dataSourceName + "_" + targetName);
			attributes.add(targetTypeAttribute);
		}
		return attributes;
	}

}