View Javadoc
1   /*
2   HideUtilityClassConstructor
3   
4   
5   */
6   
7   package com.puppycrawl.tools.checkstyle.checks.design.hideutilityclassconstructor;
8   
9   import java.io.Serializable;
10  
11  public class InputHideUtilityClassConstructorSerializableInnerStatic
12          implements Serializable {
13      private static final long serialVersionUID = 1L;
14  
15      public InputHideUtilityClassConstructorSerializableInnerStatic(int i) {
16          // no code
17      }
18  
19      public String getValue() {
20          return "";
21      }
22  
23      // It is NOT Utility Inner class
24      @SuppressWarnings("unused")
25      public static class Event {
26          // Top level class have access to fields - no need in public getters
27          private String ind;
28          private String ind1;
29  
30          public Event(String value){
31              // do a lot of calculations
32          }
33  
34          // static because this method is utility
35          public static String getEmptyString() {
36              return "";
37          }
38      }
39  
40      // It is Utility Inner class
41      @SuppressWarnings("unused")
42      public static class Event1 {
43          private String ind;
44          private String ind1;
45  
46          private Event1(){
47              // do a lot of calculations
48          }
49  
50          // static because this method is utility
51          public static String getEmptyString() {
52              return "";
53          }
54      }
55  }