001package org.gbif.api.model.collections.descriptors;
002
003import org.gbif.api.model.registry.LenientEquals;
004
005import java.io.Serializable;
006import java.util.Date;
007import java.util.Objects;
008import java.util.UUID;
009
010import javax.validation.constraints.NotBlank;
011import javax.validation.constraints.NotNull;
012
013import lombok.Data;
014
015@Data
016public class DescriptorGroup implements LenientEquals<DescriptorGroup>, Serializable {
017
018  private long key;
019  @NotBlank private String title;
020  private String description;
021  @NotNull private UUID collectionKey;
022  private Date created;
023  private String createdBy;
024  private Date modified;
025  private String modifiedBy;
026  private Date deleted;
027
028  @Override
029  public boolean lenientEquals(DescriptorGroup other) {
030    if (this == other) {
031      return true;
032    }
033
034    return key == other.key
035        && Objects.equals(title, other.title)
036        && Objects.equals(description, other.description)
037        && Objects.equals(collectionKey, other.collectionKey);
038  }
039}