View Javadoc
1   /*
2    * SPDX-License-Identifier: Apache-2.0
3    * See LICENSE file for details.
4    *
5    * Copyright 2012-2026 hazendaz
6    *
7    * Portions of initial baseline code (getter/setter test) by Rob Dawson (CodeBox)
8    */
9   package com.codebox.bean;
10  
11  import jakarta.annotation.PostConstruct;
12  
13  import java.math.BigDecimal;
14  import java.time.Instant;
15  import java.time.LocalDate;
16  import java.time.LocalDateTime;
17  import java.time.LocalTime;
18  import java.time.OffsetDateTime;
19  import java.time.ZonedDateTime;
20  import java.util.Date;
21  import java.util.List;
22  import java.util.Map;
23  import java.util.Set;
24  import java.util.UUID;
25  import java.util.concurrent.ConcurrentMap;
26  
27  import lombok.AccessLevel;
28  import lombok.Data;
29  import lombok.Getter;
30  
31  import org.slf4j.Logger;
32  
33  /**
34   * Instantiates a new sample bean.
35   */
36  @Data
37  public class SampleBean {
38  
39      /** The logger. */
40      private Logger logger;
41  
42      /** The empty bean. */
43      private EmptyBean emptyBean;
44  
45      /** The sample depth bean. */
46      private SampleDepthBean sampleDepthBean;
47  
48      /** The list. */
49      private List<String> list;
50  
51      /** The map. */
52      private Map<String, String> map;
53  
54      /** The concurrent map. */
55      private ConcurrentMap<String, String> concurrentMap;
56  
57      /** The set. */
58      private Set<String> set;
59  
60      /** The string. */
61      private final String string;
62  
63      /** The string array. */
64      private String[] stringArray;
65  
66      /** The boolean wrapper. */
67      private Boolean booleanWrapper;
68  
69      /** The int wrapper. */
70      private Integer intWrapper;
71  
72      /** The long wrapper. */
73      private Long longWrapper;
74  
75      /** The double wrapper. */
76      private Double doubleWrapper;
77  
78      /** The float wrapper. */
79      private Float floatWrapper;
80  
81      /** The character wrapper. */
82      private Character characterWrapper;
83  
84      /** The byte wrapper. */
85      private Byte byteWrapper;
86  
87      /** The byte array. */
88      private Byte[] byteArray;
89  
90      /** The boolean primitive. */
91      private boolean booleanPrimitive;
92  
93      /** The int primitive. */
94      private int intPrimitive;
95  
96      /** The long primitive. */
97      private long longPrimitive;
98  
99      /** The double primitive. */
100     private double doublePrimitive;
101 
102     /** The float primitive. */
103     private float floatPrimitive;
104 
105     /** The char primitive. */
106     private char charPrimitive;
107 
108     /** The byte primitive. */
109     private byte bytePrimitive;
110 
111     /** The big decimal. */
112     private BigDecimal bigDecimal;
113 
114     /** The uuid. */
115     private UUID uuid;
116 
117     /** The instant. */
118     private Instant instant;
119 
120     /** The date. */
121     private Date date;
122 
123     /** The Local Date. */
124     private LocalDate localDate;
125 
126     /** The Local Date Time. */
127     private LocalDateTime localDateTime;
128 
129     /** The Local Time. */
130     private LocalTime localTime;
131 
132     /** The Offset Date Time. */
133     private OffsetDateTime offsetDateTime;
134 
135     /** The Zoned Date Time. */
136     private ZonedDateTime zonedDateTime;
137 
138     /** The Boolean wrapper with is/setter style (non lombok - java metro style). */
139     @Getter(AccessLevel.NONE)
140     private Boolean booleanWrapperIsSetter;
141 
142     /** The sample enum. */
143     private SampleEnum sampleEnum;
144 
145     /**
146      * Sample enum for demonstration purposes.
147      */
148     public enum SampleEnum {
149         VALUE_ONE, VALUE_TWO, VALUE_THREE
150     }
151 
152     /**
153      * Instantiates a new sample bean (intended to be skipped.
154      *
155      * @param newString
156      *            the new string
157      * @param internal
158      *            the internal flag to set 'null' to string
159      * @deprecated This is intended to cause skip logic for deprecated constructor.
160      */
161     @Deprecated
162     public SampleBean(final String newString, final boolean internal) {
163         if (internal) {
164             this.string = "null";
165         } else {
166             this.string = newString;
167         }
168     }
169 
170     /**
171      * Instantiates a new sample bean. Causes JVM to not create a default no-arg constructor.
172      *
173      * @param newString
174      *            the new string
175      */
176     public SampleBean(final String newString) {
177         this.string = newString;
178     }
179 
180     /**
181      * Clear.
182      */
183     public void clear() {
184         // Do nothing so this is the as class setup
185     }
186 
187     /**
188      * Checks if is boolean wrapper is setter.
189      *
190      * @return the boolean
191      */
192     public Boolean isBooleanWrapperIsSetter() {
193         return this.booleanWrapperIsSetter;
194     }
195 
196     /**
197      * Sample post construct.
198      */
199     @PostConstruct
200     public void init() {
201         // Do nothing support to invoke code in clearTest()
202     }
203 }