View Javadoc
1   package com.puppycrawl.tools.checkstyle.utils.checkutils;
2   import java.util.HashMap;
3   import java.util.Map;
4   
5   import com.google.common.base.Objects;
6   
7   /**
8    * It is class.
9    * @param <V> ssss
10   * @param <C> dddd
11   */
12  public class InputCheckUtilsTest<V, C> {
13      private Map<String, Integer> field = new HashMap<>();
14      protected int[] array = new int[10];
15      public static final Long VAR_1 = 1L;
16      static final double VAR_2 = 5.0;
17  
18      @Override
19      public boolean equals(Object o) {
20          if (this == o) {
21              return true;
22          }
23          if (o == null || getClass() != o.getClass()) {
24              return false;
25          }
26          InputCheckUtilsTest<V, C> that = (InputCheckUtilsTest<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 int [] setArray(int... array) {
61          this.array = array;
62          if(array.length > 0){
63              return this.array;
64          } else {
65              return new int[4];
66          }
67      }
68  
69      public void testReceiver(InputCheckUtilsTest<V, C> this, int variable) {}
70  }