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