001/* 002 * Copyright 2020 Global Biodiversity Information Facility (GBIF) 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.gbif.api.model.registry; 017 018import java.io.Serializable; 019import java.util.Date; 020import java.util.UUID; 021 022import javax.annotation.Nullable; 023import javax.validation.constraints.NotNull; 024import javax.validation.constraints.Null; 025import javax.validation.constraints.Size; 026 027/** 028 * This interface provides a minimal contract that all network entities (The readable version) will adhere to. It is 029 * used <em>only</em> to simplify consistent testing of operations on network entities, hence the restriction to package 030 * visibility only. 031 */ 032public interface NetworkEntity extends Serializable { 033 034 @Nullable 035 @Null(groups = {PrePersist.class}) 036 @NotNull(groups = {PostPersist.class}) 037 UUID getKey(); 038 039 void setKey(UUID key); 040 041 @NotNull 042 @Size(min = 2) 043 String getTitle(); 044 045 void setTitle(String title); 046 047 @Nullable 048 String getDescription(); 049 050 void setDescription(String description); 051 052 @Null(groups = {PrePersist.class}) 053 @Nullable 054 Date getCreated(); 055 056 void setCreated(Date created); 057 058 @Null(groups = {PrePersist.class}) 059 @Nullable 060 Date getModified(); 061 062 void setModified(Date modified); 063 064 @Nullable 065 Date getDeleted(); 066 067 void setDeleted(Date deleted); 068 069 @Nullable 070 @Size(min = 3) 071 String getCreatedBy(); 072 073 void setCreatedBy(String createdBy); 074 075 @Nullable 076 @Size(min = 3) 077 String getModifiedBy(); 078 079 void setModifiedBy(String createdBy); 080}