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.model.control.rating.server.transfer; 018 019import com.echothree.model.control.rating.server.control.RatingControl; 020import com.echothree.model.data.user.server.entity.UserVisit; 021import com.echothree.util.server.transfer.BaseTransferCaches; 022 023public class RatingTransferCaches 024 extends BaseTransferCaches { 025 026 protected RatingControl ratingControl; 027 028 protected RatingTransferCache ratingTransferCache; 029 protected RatingTypeTransferCache ratingTypeTransferCache; 030 protected RatingTypeDescriptionTransferCache ratingTypeDescriptionTransferCache; 031 protected RatingTypeListItemTransferCache ratingTypeListItemTransferCache; 032 protected RatingTypeListItemDescriptionTransferCache ratingTypeListItemDescriptionTransferCache; 033 034 /** Creates a new instance of RatingTransferCaches */ 035 public RatingTransferCaches(UserVisit userVisit, RatingControl ratingControl) { 036 super(userVisit); 037 038 this.ratingControl = ratingControl; 039 } 040 041 public RatingTransferCache getRatingTransferCache() { 042 if(ratingTransferCache == null) 043 ratingTransferCache = new RatingTransferCache(userVisit, ratingControl); 044 045 return ratingTransferCache; 046 } 047 048 public RatingTypeTransferCache getRatingTypeTransferCache() { 049 if(ratingTypeTransferCache == null) 050 ratingTypeTransferCache = new RatingTypeTransferCache(userVisit, ratingControl); 051 052 return ratingTypeTransferCache; 053 } 054 055 public RatingTypeDescriptionTransferCache getRatingTypeDescriptionTransferCache() { 056 if(ratingTypeDescriptionTransferCache == null) 057 ratingTypeDescriptionTransferCache = new RatingTypeDescriptionTransferCache(userVisit, ratingControl); 058 059 return ratingTypeDescriptionTransferCache; 060 } 061 062 public RatingTypeListItemTransferCache getRatingTypeListItemTransferCache() { 063 if(ratingTypeListItemTransferCache == null) 064 ratingTypeListItemTransferCache = new RatingTypeListItemTransferCache(userVisit, ratingControl); 065 066 return ratingTypeListItemTransferCache; 067 } 068 069 public RatingTypeListItemDescriptionTransferCache getRatingTypeListItemDescriptionTransferCache() { 070 if(ratingTypeListItemDescriptionTransferCache == null) 071 ratingTypeListItemDescriptionTransferCache = new RatingTypeListItemDescriptionTransferCache(userVisit, ratingControl); 072 073 return ratingTypeListItemDescriptionTransferCache; 074 } 075 076}