forked from docker-java/docker-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathObjectVersion.java
More file actions
37 lines (30 loc) · 1.26 KB
/
Copy pathObjectVersion.java
File metadata and controls
37 lines (30 loc) · 1.26 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
package com.github.dockerjava.api.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
/**
* @since {@link RemoteApiVersion#VERSION_1_24}
* The version number of the object such as node, service, etc. This is needed to avoid conflicting writes.
* The client must send the version number along with the modified specification when updating these objects.
* This approach ensures safe concurrency and determinism in that the change on the object may not be applied
* if the version number has changed from the last read. In other words, if two update requests specify the
* same base version, only one of the requests can succeed. As a result, two separate update requests that
* happen at the same time will not unintentionally overwrite each other.
*/
@EqualsAndHashCode
public class ObjectVersion extends DockerObject implements Serializable {
private static final long serialVersionUID = 1L;
@JsonProperty("Index")
private Long index = null;
public Long getIndex() {
return index;
}
public ObjectVersion withIndex(Long index) {
this.index = index;
return this;
}
@Override
public String toString() {
return String.valueOf(index);
}
}