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

com.sinch.sdk.domains.verification.adapters.converters.LinkDtoConverter Maven / Gradle / Ivy

There is a newer version: 1.4.0
Show newest version
package com.sinch.sdk.domains.verification.adapters.converters;

import com.sinch.sdk.core.http.HttpMethod;
import com.sinch.sdk.domains.verification.models.Link;
import com.sinch.sdk.domains.verification.models.LinkRelType;
import java.util.Collection;
import java.util.stream.Collectors;

public class LinkDtoConverter {

  public static Collection convert(
      Collection dto) {
    return dto.stream().map(LinkDtoConverter::convert).collect(Collectors.toList());
  }

  public static Link convert(com.sinch.sdk.domains.verification.models.v1.start.response.Link dto) {
    return Link.builder()
        .setRel(LinkRelType.from(dto.getRel().value()))
        .setHref(dto.getHref())
        .setMethod(HttpMethod.valueOf(dto.getMethod()))
        .build();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy