001/* 002 * Licensed under the Apache License, Version 2.0 (the "License"); 003 * you may not use this file except in compliance with the License. 004 * You may obtain a copy of the License at 005 * 006 * http://www.apache.org/licenses/LICENSE-2.0 007 * 008 * Unless required by applicable law or agreed to in writing, software 009 * distributed under the License is distributed on an "AS IS" BASIS, 010 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 011 * See the License for the specific language governing permissions and 012 * limitations under the License. 013 */ 014package org.gbif.api.model.collections; 015 016import org.gbif.api.model.registry.Commentable; 017import org.gbif.api.model.registry.Identifiable; 018import org.gbif.api.model.registry.MachineTaggable; 019import org.gbif.api.model.registry.PrePersist; 020import org.gbif.api.model.registry.Taggable; 021import org.gbif.api.vocabulary.collections.MasterSourceType; 022 023import java.io.Serializable; 024import java.util.Date; 025import java.util.List; 026import java.util.UUID; 027 028import javax.annotation.Nullable; 029import javax.validation.constraints.NotNull; 030import javax.validation.constraints.Size; 031 032/** Entity . */ 033public interface CollectionEntity 034 extends Contactable, 035 Taggable, 036 MachineTaggable, 037 Identifiable, 038 Commentable, 039 OccurrenceMappeable, 040 Serializable { 041 042 /** Unique identifier. */ 043 UUID getKey(); 044 045 void setKey(UUID key); 046 047 /** Creator of the database record. */ 048 String getCreatedBy(); 049 050 void setCreatedBy(String createdBy); 051 052 /** Person or agent that modified the database record. */ 053 String getModifiedBy(); 054 055 void setModifiedBy(String modifiedBy); 056 057 /** Date when the records as created. */ 058 Date getCreated(); 059 060 void setCreated(Date created); 061 062 /** Date when the records was last modified. */ 063 Date getModified(); 064 065 void setModified(Date modified); 066 067 /** Date when the records was (logically) deleted. */ 068 @Nullable 069 Date getDeleted(); 070 071 void setDeleted(Date deleted); 072 073 /** Identifies an entity at the owner's location. */ 074 @NotNull(groups = PrePersist.class) 075 String getCode(); 076 077 void setCode(String code); 078 079 /** Descriptive name of an entity. */ 080 @NotNull 081 String getName(); 082 083 void setName(String name); 084 085 /** Textual description/summary of the contents of an entity. */ 086 @Size(min = 1) 087 String getDescription(); 088 089 void setDescription(String description); 090 091 /** Is this entity currently active/maintained. */ 092 boolean isActive(); 093 094 void setActive(boolean active); 095 096 /** Replacement of the entity (if applies). */ 097 UUID getReplacedBy(); 098 099 void setReplacedBy(UUID replacedBy); 100 101 /** Master source of the entity. */ 102 MasterSourceType getMasterSource(); 103 104 void setMasterSource(MasterSourceType masterSource); 105 106 /** Master source metadata */ 107 MasterSourceMetadata getMasterSourceMetadata(); 108 109 void setMasterSourceMetadata(MasterSourceMetadata masterSourceMetadata); 110 111 /** Flag to display the entity in the NHC portal. */ 112 Boolean getDisplayOnNHCPortal(); 113 114 void setDisplayOnNHCPortal(Boolean displayOnNHCPortal); 115 116 /** Emails of the entity */ 117 List<String> getEmail(); 118 119 void setEmail(List<String> email); 120 121 /** Phones of the entity */ 122 List<String> getPhone(); 123 124 void setPhone(List<String> phone); 125 126 /** Alternative codes of the entity */ 127 List<AlternativeCode> getAlternativeCodes(); 128 129 void setAlternativeCodes(List<AlternativeCode> alternativeCodes); 130}