All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.applitools.eyes.universal.mapper.CustomPropertyMapper Maven / Gradle / Ivy

There is a newer version: 5.76.0
Show newest version
package com.applitools.eyes.universal.mapper;

import java.util.List;
import java.util.stream.Collectors;

import com.applitools.eyes.PropertyData;
import com.applitools.eyes.universal.dto.CustomPropertyDto;

/**
 * @author Kanan
 */
public class CustomPropertyMapper {

  public static CustomPropertyDto toCustomPropertyDto(PropertyData propertyData) {
    if (propertyData == null) {
      return null;
    }

    CustomPropertyDto dto = new CustomPropertyDto();
    dto.setName(propertyData.getName());
    dto.setValue(propertyData.getValue());

    return dto;
  }

  public static List toCustomPropertyDtoList(List propertyDataList) {
    if (propertyDataList == null || propertyDataList.isEmpty()) {
      return null;
    }

    return propertyDataList.stream().map(CustomPropertyMapper::toCustomPropertyDto).collect(Collectors.toList());

  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy