forked from json-iterator/java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGenericArrayTypeImpl.java
More file actions
41 lines (30 loc) · 1020 Bytes
/
GenericArrayTypeImpl.java
File metadata and controls
41 lines (30 loc) · 1020 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package com.jsoniter.spi;
import java.lang.reflect.GenericArrayType;
import java.lang.reflect.Type;
public class GenericArrayTypeImpl implements GenericArrayType {
private final Type componentType;
GenericArrayTypeImpl(Type componentType) {
this.componentType = componentType;
}
@Override
public Type getGenericComponentType() {
return componentType;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
GenericArrayTypeImpl that = (GenericArrayTypeImpl) o;
return componentType != null ? componentType.equals(that.componentType) : that.componentType == null;
}
@Override
public int hashCode() {
return componentType != null ? componentType.hashCode() : 0;
}
@Override
public String toString() {
return "GenericArrayTypeImpl{" +
"componentType=" + componentType +
'}';
}
}