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;
009import java.util.Set;
010
011import javax.validation.constraints.NotBlank;
012import javax.validation.constraints.NotNull;
013
014import lombok.Data;
015
016@Data
017public class DescriptorGroup implements LenientEquals<DescriptorGroup>, Serializable {
018
019  private long key;
020  @NotBlank private String title;
021  private String description;
022  @NotNull private UUID collectionKey;
023  private Date created;
024  private String createdBy;
025  private Date modified;
026  private String modifiedBy;
027  private Date deleted;
028  private Set<String> tags;
029
030  @Override
031  public boolean lenientEquals(DescriptorGroup other) {
032    if (this == other) {
033      return true;
034    }
035
036    return key == other.key
037      && Objects.equals(title, other.title)
038      && Objects.equals(description, other.description)
039      && Objects.equals(collectionKey, other.collectionKey)
040      && Objects.equals(tags, other.tags);
041  }
042}