001// --------------------------------------------------------------------------------
002// Copyright 2002-2026 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// Generated File -- DO NOT EDIT BY HAND
017// --------------------------------------------------------------------------------
018
019/**
020 * AppearanceDetail.java
021 */
022
023package com.echothree.model.data.core.server.entity;
024
025import com.echothree.model.data.core.common.pk.AppearanceDetailPK;
026
027import com.echothree.model.data.core.common.pk.AppearancePK;
028import com.echothree.model.data.core.common.pk.ColorPK;
029import com.echothree.model.data.core.common.pk.FontStylePK;
030import com.echothree.model.data.core.common.pk.FontWeightPK;
031
032import com.echothree.model.data.core.server.entity.Appearance;
033import com.echothree.model.data.core.server.entity.Color;
034import com.echothree.model.data.core.server.entity.FontStyle;
035import com.echothree.model.data.core.server.entity.FontWeight;
036
037import com.echothree.model.data.core.server.factory.AppearanceFactory;
038import com.echothree.model.data.core.server.factory.ColorFactory;
039import com.echothree.model.data.core.server.factory.FontStyleFactory;
040import com.echothree.model.data.core.server.factory.FontWeightFactory;
041
042import com.echothree.model.data.core.common.pk.AppearanceDetailPK;
043
044import com.echothree.model.data.core.server.value.AppearanceDetailValue;
045
046import com.echothree.model.data.core.server.factory.AppearanceDetailFactory;
047
048import com.echothree.util.common.exception.PersistenceException;
049import com.echothree.util.common.exception.PersistenceDatabaseException;
050import com.echothree.util.common.exception.PersistenceNotNullException;
051import com.echothree.util.common.exception.PersistenceReadOnlyException;
052
053import com.echothree.util.common.persistence.BasePK;
054
055import com.echothree.util.common.persistence.type.ByteArray;
056
057import com.echothree.util.server.persistence.BaseEntity;
058import com.echothree.util.server.persistence.EntityPermission;
059import com.echothree.util.server.persistence.Session;
060import com.echothree.util.server.persistence.ThreadSession;
061
062import java.io.Serializable;
063
064public class AppearanceDetail
065        extends BaseEntity
066        implements Serializable {
067    
068    private AppearanceDetailPK _pk;
069    private AppearanceDetailValue _value;
070    
071    /** Creates a new instance of AppearanceDetail */
072    public AppearanceDetail()
073            throws PersistenceException {
074        super();
075    }
076    
077    /** Creates a new instance of AppearanceDetail */
078    public AppearanceDetail(AppearanceDetailValue value, EntityPermission entityPermission) {
079        super(entityPermission);
080        
081        _value = value;
082        _pk = value.getPrimaryKey();
083    }
084    
085    @Override
086    public AppearanceDetailFactory getBaseFactoryInstance() {
087        return AppearanceDetailFactory.getInstance();
088    }
089    
090    @Override
091    public boolean hasBeenModified() {
092        return _value.hasBeenModified();
093    }
094    
095    @Override
096    public int hashCode() {
097        return _pk.hashCode();
098    }
099    
100    @Override
101    public String toString() {
102        return _pk.toString();
103    }
104    
105    @Override
106    public boolean equals(Object other) {
107        if(this == other)
108            return true;
109        
110        if(other instanceof AppearanceDetail that) {
111            AppearanceDetailValue thatValue = that.getAppearanceDetailValue();
112            return _value.equals(thatValue);
113        } else {
114            return false;
115        }
116    }
117    
118    @Override
119    public void store()
120            throws PersistenceDatabaseException {
121        getBaseFactoryInstance().store(this);
122    }
123    
124    @Override
125    public void remove()
126            throws PersistenceDatabaseException {
127        getBaseFactoryInstance().remove(this);
128    }
129    
130    public AppearanceDetailValue getAppearanceDetailValue() {
131        return _value;
132    }
133    
134    public void setAppearanceDetailValue(AppearanceDetailValue value)
135            throws PersistenceReadOnlyException {
136        checkReadWrite();
137        _value = value;
138    }
139    
140    @Override
141    public AppearanceDetailPK getPrimaryKey() {
142        return _pk;
143    }
144    
145    public AppearancePK getAppearancePK() {
146        return _value.getAppearancePK();
147    }
148    
149    public Appearance getAppearance(EntityPermission entityPermission) {
150        return AppearanceFactory.getInstance().getEntityFromPK(entityPermission, getAppearancePK());
151    }
152    
153    public Appearance getAppearance() {
154        return getAppearance(EntityPermission.READ_ONLY);
155    }
156    
157    public Appearance getAppearanceForUpdate() {
158        return getAppearance(EntityPermission.READ_WRITE);
159    }
160    
161    public void setAppearancePK(AppearancePK appearancePK)
162            throws PersistenceNotNullException, PersistenceReadOnlyException {
163        checkReadWrite();
164        _value.setAppearancePK(appearancePK);
165    }
166    
167    public void setAppearance(Appearance entity) {
168        setAppearancePK(entity == null? null: entity.getPrimaryKey());
169    }
170    
171    public boolean getAppearancePKHasBeenModified() {
172        return _value.getAppearancePKHasBeenModified();
173    }
174    
175    public String getAppearanceName() {
176        return _value.getAppearanceName();
177    }
178    
179    public void setAppearanceName(String appearanceName)
180            throws PersistenceNotNullException, PersistenceReadOnlyException {
181        checkReadWrite();
182        _value.setAppearanceName(appearanceName);
183    }
184    
185    public boolean getAppearanceNameHasBeenModified() {
186        return _value.getAppearanceNameHasBeenModified();
187    }
188    
189    public ColorPK getTextColorPK() {
190        return _value.getTextColorPK();
191    }
192    
193    public Color getTextColor(EntityPermission entityPermission) {
194        ColorPK pk = getTextColorPK();
195        Color entity = pk == null? null: ColorFactory.getInstance().getEntityFromPK(entityPermission, pk);
196        
197        return entity;
198    }
199    
200    public Color getTextColor() {
201        return getTextColor(EntityPermission.READ_ONLY);
202    }
203    
204    public Color getTextColorForUpdate() {
205        return getTextColor(EntityPermission.READ_WRITE);
206    }
207    
208    public void setTextColorPK(ColorPK textColorPK)
209            throws PersistenceNotNullException, PersistenceReadOnlyException {
210        checkReadWrite();
211        _value.setTextColorPK(textColorPK);
212    }
213    
214    public void setTextColor(Color entity) {
215        setTextColorPK(entity == null? null: entity.getPrimaryKey());
216    }
217    
218    public boolean getTextColorPKHasBeenModified() {
219        return _value.getTextColorPKHasBeenModified();
220    }
221    
222    public ColorPK getBackgroundColorPK() {
223        return _value.getBackgroundColorPK();
224    }
225    
226    public Color getBackgroundColor(EntityPermission entityPermission) {
227        ColorPK pk = getBackgroundColorPK();
228        Color entity = pk == null? null: ColorFactory.getInstance().getEntityFromPK(entityPermission, pk);
229        
230        return entity;
231    }
232    
233    public Color getBackgroundColor() {
234        return getBackgroundColor(EntityPermission.READ_ONLY);
235    }
236    
237    public Color getBackgroundColorForUpdate() {
238        return getBackgroundColor(EntityPermission.READ_WRITE);
239    }
240    
241    public void setBackgroundColorPK(ColorPK backgroundColorPK)
242            throws PersistenceNotNullException, PersistenceReadOnlyException {
243        checkReadWrite();
244        _value.setBackgroundColorPK(backgroundColorPK);
245    }
246    
247    public void setBackgroundColor(Color entity) {
248        setBackgroundColorPK(entity == null? null: entity.getPrimaryKey());
249    }
250    
251    public boolean getBackgroundColorPKHasBeenModified() {
252        return _value.getBackgroundColorPKHasBeenModified();
253    }
254    
255    public FontStylePK getFontStylePK() {
256        return _value.getFontStylePK();
257    }
258    
259    public FontStyle getFontStyle(EntityPermission entityPermission) {
260        FontStylePK pk = getFontStylePK();
261        FontStyle entity = pk == null? null: FontStyleFactory.getInstance().getEntityFromPK(entityPermission, pk);
262        
263        return entity;
264    }
265    
266    public FontStyle getFontStyle() {
267        return getFontStyle(EntityPermission.READ_ONLY);
268    }
269    
270    public FontStyle getFontStyleForUpdate() {
271        return getFontStyle(EntityPermission.READ_WRITE);
272    }
273    
274    public void setFontStylePK(FontStylePK fontStylePK)
275            throws PersistenceNotNullException, PersistenceReadOnlyException {
276        checkReadWrite();
277        _value.setFontStylePK(fontStylePK);
278    }
279    
280    public void setFontStyle(FontStyle entity) {
281        setFontStylePK(entity == null? null: entity.getPrimaryKey());
282    }
283    
284    public boolean getFontStylePKHasBeenModified() {
285        return _value.getFontStylePKHasBeenModified();
286    }
287    
288    public FontWeightPK getFontWeightPK() {
289        return _value.getFontWeightPK();
290    }
291    
292    public FontWeight getFontWeight(EntityPermission entityPermission) {
293        FontWeightPK pk = getFontWeightPK();
294        FontWeight entity = pk == null? null: FontWeightFactory.getInstance().getEntityFromPK(entityPermission, pk);
295        
296        return entity;
297    }
298    
299    public FontWeight getFontWeight() {
300        return getFontWeight(EntityPermission.READ_ONLY);
301    }
302    
303    public FontWeight getFontWeightForUpdate() {
304        return getFontWeight(EntityPermission.READ_WRITE);
305    }
306    
307    public void setFontWeightPK(FontWeightPK fontWeightPK)
308            throws PersistenceNotNullException, PersistenceReadOnlyException {
309        checkReadWrite();
310        _value.setFontWeightPK(fontWeightPK);
311    }
312    
313    public void setFontWeight(FontWeight entity) {
314        setFontWeightPK(entity == null? null: entity.getPrimaryKey());
315    }
316    
317    public boolean getFontWeightPKHasBeenModified() {
318        return _value.getFontWeightPKHasBeenModified();
319    }
320    
321    public Boolean getIsDefault() {
322        return _value.getIsDefault();
323    }
324    
325    public void setIsDefault(Boolean isDefault)
326            throws PersistenceNotNullException, PersistenceReadOnlyException {
327        checkReadWrite();
328        _value.setIsDefault(isDefault);
329    }
330    
331    public boolean getIsDefaultHasBeenModified() {
332        return _value.getIsDefaultHasBeenModified();
333    }
334    
335    public Integer getSortOrder() {
336        return _value.getSortOrder();
337    }
338    
339    public void setSortOrder(Integer sortOrder)
340            throws PersistenceNotNullException, PersistenceReadOnlyException {
341        checkReadWrite();
342        _value.setSortOrder(sortOrder);
343    }
344    
345    public boolean getSortOrderHasBeenModified() {
346        return _value.getSortOrderHasBeenModified();
347    }
348    
349    public Long getFromTime() {
350        return _value.getFromTime();
351    }
352    
353    public void setFromTime(Long fromTime)
354            throws PersistenceNotNullException, PersistenceReadOnlyException {
355        checkReadWrite();
356        _value.setFromTime(fromTime);
357    }
358    
359    public boolean getFromTimeHasBeenModified() {
360        return _value.getFromTimeHasBeenModified();
361    }
362    
363    public Long getThruTime() {
364        return _value.getThruTime();
365    }
366    
367    public void setThruTime(Long thruTime)
368            throws PersistenceNotNullException, PersistenceReadOnlyException {
369        checkReadWrite();
370        _value.setThruTime(thruTime);
371    }
372    
373    public boolean getThruTimeHasBeenModified() {
374        return _value.getThruTimeHasBeenModified();
375    }
376    
377}