class TargetTypesServiceImpl implements TargetTypesService {

	@Override
	public TargetTypes getTargetTypesByName(String targetTypeName) throws PacManException {
		boolean isTargetTypeExits = targetTypesRepository.existsById(targetTypeName);
		if (!isTargetTypeExits) {
			throw new PacManException(AdminConstants.TARGET_TYPE_NAME_NOT_EXITS);
		} else {
			return targetTypesRepository.findById(targetTypeName).get();
		}
	}

}