blob: f81386f1251c448fb58fa709932a92abec0fcc22 (
plain) (
blame)
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
|
/*
* SPDX-FileCopyrightText: 2023 The Refinery Authors <https://refinery.tools/>
*
* SPDX-License-Identifier: EPL-2.0
*/
package tools.refinery.store.model.internal;
import tools.refinery.store.map.Version;
import java.util.Arrays;
public class ModelVersion implements Version {
final Version[] mapVersions;
final int hash;
public ModelVersion(Version[] mapVersions) {
this.mapVersions = mapVersions;
this.hash = Arrays.hashCode(mapVersions);
}
public static Version getInternalVersion(Version modelVersion, int interpretationIndex) {
return ((ModelVersion) modelVersion).mapVersions[interpretationIndex];
}
@Override
public int hashCode() {
return hash;
}
@Override
public boolean equals(Object obj) {
return super.equals(obj);
}
@Override
public String toString() {
return "ModelVersion{" +
"mapVersions=" + Arrays.toString(mapVersions) +
'}';
}
}
|