public class Volume
extends java.lang.Object
implements java.io.Serializable
Due to an inconsistency in the Docker REST API implementation the response to a container
command might include either "Mounts" : [ { "Destination" : "/path/to/mount" } ]
or
"Mounts" : [ { "Destination" : { "path" : "/path/to/mount" } } ]
JSON snippets. However,
both variants have to be mapped to this class. Therefore, both a single-argument constructor
as well as a single-argument factory method is provided either of which handles the former or
latter variant (with path
key), respectively.
Bind
,
Serialized FormConstructor and Description |
---|
Volume(java.lang.String path)
Creates a volume referring to the given path.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getPath() |
int |
hashCode() |
static Volume |
parse(java.lang.String path)
Handles the
{ "Destination" : { "path" : "/path/to/mount" } } variant. |
java.lang.String |
toString() |
public Volume(java.lang.String path)
{ "Destination" : "/path/to/mount" }
variant.path
- the destination path of the bind mounted volume@Nonnull public static Volume parse(java.lang.String path)
{ "Destination" : { "path" : "/path/to/mount" } }
variant.path
- the destination path of the bind mounted volumepublic java.lang.String getPath()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
Copyright © 2019. All Rights Reserved.