LayerSpec.java
2.44 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* org.jetbrains.annotations.NotNull
* org.jetbrains.annotations.Nullable
*/
package com.scene7.is.ps.provider.defs;
import com.scene7.is.ps.provider.Request;
import java.io.Serializable;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class LayerSpec
implements Serializable {
@NotNull
private final Object layerId;
@Nullable
private final String layerName;
public static final LayerSpec LAYER_COMP = new LayerSpec("COMP", null);
public static final LayerSpec LAYER_0 = new LayerSpec(Request.ID_LAYER_0, null);
public LayerSpec(Object layerId, @Nullable String layerName) {
assert (layerId instanceof String || layerId instanceof Integer);
if (layerId instanceof Integer && !$assertionsDisabled && (Integer)layerId < 0) {
throw new AssertionError();
}
if (layerName != null && !$assertionsDisabled && layerName.length() <= 0) {
throw new AssertionError();
}
this.layerId = layerId;
this.layerName = layerName;
}
@NotNull
public String toString() {
StringBuilder builder = new StringBuilder();
if (this.layerId instanceof String) {
builder.append(((String)this.layerId).toUpperCase());
} else {
assert (this.layerId instanceof Integer);
builder.append(this.layerId);
}
if (this.layerName != null) {
builder.append(',');
builder.append(this.layerName);
}
return builder.toString();
}
@NotNull
public Object getLayerId() {
return this.layerId;
}
@Nullable
public String getLayerName() {
return this.layerName;
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || this.getClass() != obj.getClass()) {
return false;
}
LayerSpec that = (LayerSpec)obj;
if (!this.layerId.equals(that.layerId)) {
return false;
}
if (this.layerName == null) {
return that.layerName == null;
}
return this.layerName.equals(that.layerName);
}
public int hashCode() {
int result = this.layerId.hashCode();
result = 31 * result + (this.layerName != null ? this.layerName.hashCode() : 0);
return result;
}
}