View Javadoc
1   /*
2    * JavaBean Tester (https://github.com/hazendaz/javabean-tester)
3    *
4    * Copyright 2012-2024 Hazendaz.
5    *
6    * All rights reserved. This program and the accompanying materials
7    * are made available under the terms of The Apache Software License,
8    * Version 2.0 which accompanies this distribution, and is available at
9    * http://www.apache.org/licenses/LICENSE-2.0.txt
10   *
11   * Contributors:
12   *     CodeBox (Rob Dawson).
13   *     Hazendaz (Jeremy Landis).
14   */
15  package com.codebox.bean;
16  
17  import jakarta.annotation.PostConstruct;
18  
19  import java.math.BigDecimal;
20  import java.time.Instant;
21  import java.time.LocalDate;
22  import java.time.LocalDateTime;
23  import java.time.LocalTime;
24  import java.time.OffsetDateTime;
25  import java.time.ZonedDateTime;
26  import java.util.Date;
27  import java.util.List;
28  import java.util.Map;
29  import java.util.TreeSet;
30  import java.util.UUID;
31  import java.util.concurrent.ConcurrentMap;
32  
33  import lombok.AccessLevel;
34  import lombok.Data;
35  import lombok.Getter;
36  
37  import org.slf4j.Logger;
38  
39  /**
40   * Instantiates a new sample bean.
41   */
42  @Data
43  public class SampleBean {
44  
45      /** The logger. */
46      private Logger logger;
47  
48      /** The empty bean. */
49      private EmptyBean emptyBean;
50  
51      /** The sample depth bean. */
52      private SampleDepthBean sampleDepthBean;
53  
54      /** The list. */
55      private List<String> list;
56  
57      /** The map. */
58      private Map<String, String> map;
59  
60      /** The concurrent map. */
61      private ConcurrentMap<String, String> concurrentMap;
62  
63      /** The tree set. */
64      private TreeSet<String> treeSet;
65  
66      /** The string. */
67      private final String string;
68  
69      /** The string array. */
70      private String[] stringArray;
71  
72      /** The boolean wrapper. */
73      private Boolean booleanWrapper;
74  
75      /** The int wrapper. */
76      private Integer intWrapper;
77  
78      /** The long wrapper. */
79      private Long longWrapper;
80  
81      /** The double wrapper. */
82      private Double doubleWrapper;
83  
84      /** The float wrapper. */
85      private Float floatWrapper;
86  
87      /** The character wrapper. */
88      private Character characterWrapper;
89  
90      /** The byte wrapper. */
91      private Byte byteWrapper;
92  
93      /** The byte array. */
94      private Byte[] byteArray;
95  
96      /** The boolean primitive. */
97      private boolean booleanPrimitive;
98  
99      /** The int primitive. */
100     private int intPrimitive;
101 
102     /** The long primitive. */
103     private long longPrimitive;
104 
105     /** The double primitive. */
106     private double doublePrimitive;
107 
108     /** The float primitive. */
109     private float floatPrimitive;
110 
111     /** The char primitive. */
112     private char charPrimitive;
113 
114     /** The byte primitive. */
115     private byte bytePrimitive;
116 
117     /** The big decimal. */
118     private BigDecimal bigDecimal;
119 
120     /** The uuid. */
121     private UUID uuid;
122 
123     /** The instant. */
124     private Instant instant;
125 
126     /** The date. */
127     private Date date;
128 
129     /** The Local Date. */
130     private LocalDate localDate;
131 
132     /** The Local Date Time. */
133     private LocalDateTime localDateTime;
134 
135     /** The Local Time. */
136     private LocalTime localTime;
137 
138     /** The Offset Date Time. */
139     private OffsetDateTime offsetDateTime;
140 
141     /** The Zoned Date Time. */
142     private ZonedDateTime zonedDateTime;
143 
144     /** The Boolean wrapper with is/setter style (non lombok - java metro style). */
145     @Getter(AccessLevel.NONE)
146     private Boolean booleanWrapperIsSetter;
147 
148     /**
149      * Instantiates a new sample bean. Causes JVM to not create a default no-arg constructor.
150      *
151      * @param newString
152      *            the new string
153      */
154     public SampleBean(final String newString) {
155         this.string = newString;
156     }
157 
158     /**
159      * Clear.
160      */
161     public void clear() {
162         // Do nothing so this is the as class setup
163     }
164 
165     /**
166      * Checks if is boolean wrapper is setter.
167      *
168      * @return the boolean
169      */
170     public Boolean isBooleanWrapperIsSetter() {
171         return this.booleanWrapperIsSetter;
172     }
173 
174     /**
175      * Sample post construct.
176      */
177     @PostConstruct
178     public void init() {
179         // Do nothing support to invoke code in clearTest()
180     }
181 }