import java.io.ObjectOutput;
import java.io.ObjectStreamException;
import java.io.Serial;
-import org.eclipse.jdt.annotation.Nullable;
final class KeyedInstanceIdentifierV2<T extends KeyAware<K> & DataObject, K extends Key<T>>
extends InstanceIdentifierV3<T> {
- @Serial
+ @java.io.Serial
private static final long serialVersionUID = 2L;
- private @Nullable K key;
+ private K key;
@SuppressWarnings("redundantModifier")
public KeyedInstanceIdentifierV2() {
// For Externalizable
}
- KeyedInstanceIdentifierV2(final KeyedInstanceIdentifier<T, K> source) {
- super(source);
- key = source.getKey();
- }
-
@Override
public void writeExternal(final ObjectOutput out) throws IOException {
super.writeExternal(out);
@Serial
@Override
Object readResolve() throws ObjectStreamException {
- return new KeyedInstanceIdentifier<>(getTargetType(), getPathArguments(), isWildcarded(), getHash(), key);
+ return new KeyedInstanceIdentifier<>(new KeyStep<>(getTargetType(), key), getPathArguments(),
+ isWildcarded(), getHash());
}
}