NomRessurs.java

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

  2. import lombok.AllArgsConstructor;
  3. import lombok.Builder;
  4. import lombok.Data;
  5. import lombok.EqualsAndHashCode;
  6. import lombok.NoArgsConstructor;
  7. import org.apache.commons.lang3.StringUtils;

  8. import java.time.LocalDate;

  9. @SuppressWarnings("SpellCheckingInspection")
  10. @Data
  11. @Builder
  12. @AllArgsConstructor
  13. @NoArgsConstructor
  14. @EqualsAndHashCode(exclude = {"partition", "offset"})
  15. public class NomRessurs {

  16.     private String personident;
  17.     private String navident;
  18.     private String ressurstype;
  19.     private String fornavn;
  20.     private String etternavn;
  21.     private String epost;
  22.     private Boolean permisjon;
  23.     private LocalDate startdato;
  24.     private LocalDate sluttdato;

  25.     private int partition;
  26.     private long offset;

  27.     public String getFullName() {
  28.         return StringUtils.trimToNull(
  29.                 StringUtils.trimToEmpty(fornavn) + " " + StringUtils.trimToEmpty(etternavn)
  30.         );
  31.     }

  32.     public NomRessurs addKafkaData(int partition, long offset) {
  33.         this.partition = partition;
  34.         this.offset = offset;
  35.         return this;
  36.     }
  37. }