LocationSimpleResponse.java

  1. package no.nav.data.team.location.dto;

  2. import lombok.AllArgsConstructor;
  3. import lombok.Data;
  4. import lombok.NoArgsConstructor;
  5. import lombok.experimental.SuperBuilder;
  6. import no.nav.data.team.location.domain.Location;
  7. import no.nav.data.team.location.domain.LocationType;

  8. @Data
  9. @SuperBuilder
  10. @NoArgsConstructor
  11. @AllArgsConstructor
  12. public class LocationSimpleResponse {
  13.     String code;
  14.     LocationType type;
  15.     String description;
  16.     String displayName;

  17.     public static LocationSimpleResponse convert(Location location){
  18.         return LocationSimpleResponse.builder()
  19.                 .code(location.getCode())
  20.                 .description(location.getDescription())
  21.                 .type(location.getType())
  22.                 .displayName(location.getDisplayName())
  23.                 .build();
  24.     }
  25. }