View Javadoc
1   package com.puppycrawl.tools.checkstyle.checks.javadoc.missingjavadocmethod;
2   import com.google.common.base.Objects;
3   import java.util.HashMap;
4   import java.util.Map;
5   
6   /**
7    * It is class.
8    * @param <V> ssss
9    * @param <C> dddd
10   */
11  public class InputMissingJavadocMethodSetterGetter3<V, C> {
12      private Map<String, Integer> field = new HashMap<>();
13      protected int[] array = new int[10];
14      public static final Long VAR_1 = 1L;
15      static final double VAR_2 = 5.0;
16  
17      @Override
18      public boolean equals(Object o) {
19          if (this == o) {
20              return true;
21          }
22          if (o == null || getClass() != o.getClass()) {
23              return false;
24          }
25          InputMissingJavadocMethodSetterGetter3<V, C> that =
26                  (InputMissingJavadocMethodSetterGetter3<V, C>) o;
27          return Objects.equal(field, that.field) &&
28                  Objects.equal(array, that.array);
29      }
30  
31      public void doSomething(int value) {
32          if (field.isEmpty()) {
33              field.put(String.valueOf(value), value << 1);
34          } else {
35              if(!field.containsKey(String.valueOf(value))){
36                  field.put(String.valueOf(value), value << 1);
37              }
38          }
39  
40          if(!field.containsKey(String.valueOf(value))){
41              field.put(String.valueOf(value), value << 1);
42          } else if (value == 10) {
43              array[9] = -1;
44          }
45  
46          if(field.size() < 10){
47              array[9] = field.getOrDefault(String.valueOf(value), -1);
48          }
49  
50      }
51  
52      public Map<String, Integer> getField() {
53          return new HashMap<>(field);
54      }
55  
56      public void setField(Map<String, Integer> field) {
57          this.field = field;
58      }
59  
60      public void setArray(String name, int... array) {
61          this.array = array;
62      }
63  
64      public void anotherMethod(int... array) {
65          this.array = array;
66      }
67  
68      public void testReceiver(InputMissingJavadocMethodSetterGetter3<V, C>this, int variable) {}
69  
70      public interface Example {
71          void method();
72      }
73  }