001// -------------------------------------------------------------------------------- 002// Copyright 2002-2024 Echo Three, LLC 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// -------------------------------------------------------------------------------- 016 017package com.echothree.util.common.transfer; 018 019import com.echothree.model.control.comment.common.transfer.CommentListWrapper; 020import com.echothree.model.control.core.common.transfer.EntityAliasTypeTransfer; 021import com.echothree.model.control.core.common.transfer.EntityAttributeGroupTransfer; 022import com.echothree.model.control.core.common.transfer.EntityInstanceTransfer; 023import com.echothree.model.control.rating.common.transfer.RatingListWrapper; 024import com.echothree.model.control.tag.common.transfer.TagScopeTransfer; 025import com.echothree.model.control.workeffort.common.transfer.WorkEffortTransfer; 026import java.io.Serializable; 027 028public class BaseTransfer 029 implements Serializable { 030 031 private EntityInstanceTransfer entityInstance; 032 private MapWrapper<EntityAliasTypeTransfer> entityAliasTypes; 033 private MapWrapper<EntityAttributeGroupTransfer> entityAttributeGroups; 034 private MapWrapper<TagScopeTransfer> tagScopes; 035 private MapWrapper<CommentListWrapper> comments; 036 private MapWrapper<RatingListWrapper> ratings; 037 private MapWrapper<WorkEffortTransfer> ownedWorkEfforts; 038 039 public EntityInstanceTransfer getEntityInstance() { 040 return entityInstance; 041 } 042 043 public void setEntityInstance(EntityInstanceTransfer entityInstance) { 044 this.entityInstance = entityInstance; 045 } 046 047 public MapWrapper<EntityAliasTypeTransfer> getEntityAliasTypes() { 048 return entityAliasTypes; 049 } 050 051 public void setEntityAliasTypes(MapWrapper<EntityAliasTypeTransfer> entityAliasTypes) { 052 this.entityAliasTypes = entityAliasTypes; 053 } 054 055 public MapWrapper<EntityAttributeGroupTransfer> getEntityAttributeGroups() { 056 return entityAttributeGroups; 057 } 058 059 public void setEntityAttributeGroups(MapWrapper<EntityAttributeGroupTransfer> entityAttributeGroups) { 060 this.entityAttributeGroups = entityAttributeGroups; 061 } 062 063 public MapWrapper<TagScopeTransfer> getTagScopes() { 064 return tagScopes; 065 } 066 067 public void setTagScopes(MapWrapper<TagScopeTransfer> tagScopes) { 068 this.tagScopes = tagScopes; 069 } 070 071 public MapWrapper<CommentListWrapper> getComments() { 072 return comments; 073 } 074 075 public void setComments(MapWrapper<CommentListWrapper> comments) { 076 this.comments = comments; 077 } 078 079 public void addComments(String commentTypeName, CommentListWrapper wrappedComments) { 080 if(comments == null) { 081 comments = new MapWrapper<>(); 082 } 083 084 comments.put(commentTypeName, wrappedComments); 085 } 086 087 public MapWrapper<RatingListWrapper> getRatings() { 088 return ratings; 089 } 090 091 public void setRatings(MapWrapper<RatingListWrapper> ratings) { 092 this.ratings = ratings; 093 } 094 095 public void addRatings(String ratingTypeName, RatingListWrapper wrappedRatings) { 096 if(ratings == null) { 097 ratings = new MapWrapper<>(); 098 } 099 100 ratings.put(ratingTypeName, wrappedRatings); 101 } 102 103 public MapWrapper<WorkEffortTransfer> getOwnedWorkEfforts() { 104 return ownedWorkEfforts; 105 } 106 107 public void setOwnedWorkEfforts(MapWrapper<WorkEffortTransfer> ownedWorkEfforts) { 108 this.ownedWorkEfforts = ownedWorkEfforts; 109 } 110 111 public void addOwnedWorkEffort(String workEffortTypeName, WorkEffortTransfer ownedWorkEffort) { 112 if(ownedWorkEfforts == null) { 113 ownedWorkEfforts = new MapWrapper<>(1); 114 } 115 116 ownedWorkEfforts.put(workEffortTypeName, ownedWorkEffort); 117 } 118 119}