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.util.HttpURI; 022import org.gbif.api.vocabulary.License; 023import org.gbif.api.vocabulary.collections.MasterSourceType; 024 025import java.io.Serializable; 026import java.net.URI; 027import java.util.Date; 028import java.util.List; 029import java.util.UUID; 030 031import javax.annotation.Nullable; 032import javax.validation.constraints.NotNull; 033import javax.validation.constraints.Size; 034 035/** Entity . */ 036public interface CollectionEntity 037 extends Contactable, 038 Taggable, 039 MachineTaggable, 040 Identifiable, 041 Commentable, 042 OccurrenceMappeable, 043 Serializable { 044 045 /** Unique identifier. */ 046 UUID getKey(); 047 048 void setKey(UUID key); 049 050 /** Creator of the database record. */ 051 String getCreatedBy(); 052 053 void setCreatedBy(String createdBy); 054 055 /** Person or agent that modified the database record. */ 056 String getModifiedBy(); 057 058 void setModifiedBy(String modifiedBy); 059 060 /** Date when the records as created. */ 061 Date getCreated(); 062 063 void setCreated(Date created); 064 065 /** Date when the records was last modified. */ 066 Date getModified(); 067 068 void setModified(Date modified); 069 070 /** Date when the records was (logically) deleted. */ 071 @Nullable 072 Date getDeleted(); 073 074 void setDeleted(Date deleted); 075 076 /** Identifies an entity at the owner's location. */ 077 @NotNull(groups = PrePersist.class) 078 String getCode(); 079 080 void setCode(String code); 081 082 /** Descriptive name of an entity. */ 083 @NotNull 084 String getName(); 085 086 void setName(String name); 087 088 /** Textual description/summary of the contents of an entity. */ 089 @Size(min = 1) 090 String getDescription(); 091 092 void setDescription(String description); 093 094 /** Is this entity currently active/maintained. */ 095 boolean isActive(); 096 097 void setActive(boolean active); 098 099 /** Replacement of the entity (if applies). */ 100 UUID getReplacedBy(); 101 102 void setReplacedBy(UUID replacedBy); 103 104 /** Master source of the entity. */ 105 MasterSourceType getMasterSource(); 106 107 void setMasterSource(MasterSourceType masterSource); 108 109 /** Master source metadata */ 110 MasterSourceMetadata getMasterSourceMetadata(); 111 112 void setMasterSourceMetadata(MasterSourceMetadata masterSourceMetadata); 113 114 /** Flag to display the entity in the NHC portal. */ 115 Boolean getDisplayOnNHCPortal(); 116 117 void setDisplayOnNHCPortal(Boolean displayOnNHCPortal); 118 119 /** Emails of the entity */ 120 List<String> getEmail(); 121 122 void setEmail(List<String> email); 123 124 /** Phones of the entity */ 125 List<String> getPhone(); 126 127 void setPhone(List<String> phone); 128 129 /** Alternative codes of the entity */ 130 List<AlternativeCode> getAlternativeCodes(); 131 132 void setAlternativeCodes(List<AlternativeCode> alternativeCodes); 133 134 @HttpURI 135 @Nullable 136 URI getFeaturedImageUrl(); 137 138 void setFeaturedImageUrl(URI featuredImageUrl); 139 140 @Nullable 141 License getFeaturedImageLicense(); 142 143 void setFeaturedImageLicense(License featuredImageLicense); 144 145 @Nullable 146 String getFeaturedImageAttribution(); 147 148 void setFeaturedImageAttribution(String featuredImageAttribution); 149}