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