Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Swaps responses' toStrings for Commons' ToStringBuilder
Replacing more boilder-plate code with something that'll be easier to
maintain.
  • Loading branch information
mfulgo committed Aug 1, 2014
commit 442fa8b532ac467aaaaafb978c89d6b0e62984b8
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.commons.lang.builder.ToStringBuilder;

import java.util.Arrays;

Expand Down Expand Up @@ -37,9 +38,6 @@ public void setWarnings(String[] warnings) {

@Override
public String toString() {
return "CreateContainerResponse{" +
"id='" + id + '\'' +
", warnings=" + Arrays.toString(warnings) +
'}';
return ToStringBuilder.reflectionToString(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.commons.lang.builder.ToStringBuilder;

/**
* Parse reponses from /images/create
Expand All @@ -15,16 +16,12 @@ public class CreateImageResponse {
@JsonProperty("status")
private String id;


public String getId() {
return id;
}


@Override
public String toString() {
return "CreateImageResponse{" +
"id='" + id + '\'' +
'}';
return ToStringBuilder.reflectionToString(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.github.dockerjava.client.model.*;
import org.apache.commons.lang.builder.ToStringBuilder;

/**
*
Expand Down Expand Up @@ -187,16 +188,9 @@ public Ports getPorts() {
}


@Override
@Override
public String toString() {
return "NetworkSettings{" +
"ports=" + ports +
", portMapping=" + portMapping +
", bridge='" + bridge + '\'' +
", gateway='" + gateway + '\'' +
", ipPrefixLen=" + ipPrefixLen +
", ipAddress='" + ipAddress + '\'' +
'}';
return ToStringBuilder.reflectionToString(this);
}
}

Expand Down Expand Up @@ -234,16 +228,9 @@ public String getFinishedAt() {
return finishedAt;
}

@Override
@Override
public String toString() {
return "ContainerState{" +
"running=" + running +
", paused=" + paused +
", pid=" + pid +
", exitCode=" + exitCode +
", startedAt='" + startedAt + '\'' +
", finishedAt='" + finishedAt + '\'' +
'}';
return ToStringBuilder.reflectionToString(this);
}
}

Expand Down Expand Up @@ -328,19 +315,9 @@ public String getNetworkMode() {
return networkMode;
}

@Override
@Override
public String toString() {
return "HostConfig{" +
"binds=" + Arrays.toString(binds) +
", containerIDFile='" + containerIDFile + '\'' +
", lxcConf=" + Arrays.toString(lxcConf) +
", links=" + Arrays.toString(links) +
", portBindings=" + portBindings +
", privileged=" + privileged +
", publishAllPorts=" + publishAllPorts +
", networkMode=" + networkMode +
", dns='" + dns + '\'' +
'}';
return ToStringBuilder.reflectionToString(this);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.github.dockerjava.client.model.ContainerConfig;
import org.apache.commons.lang.builder.ToStringBuilder;

/**
*
Expand Down Expand Up @@ -96,21 +97,8 @@ public String getOs() {
return os;
}

@Override
@Override
public String toString() {
return "InspectImageResponse{" +
"id='" + id + '\'' +
", parent='" + parent + '\'' +
", created='" + created + '\'' +
", container='" + container + '\'' +
", containerConfig=" + containerConfig +
", size=" + size +
", dockerVersion='" + dockerVersion + '\'' +
", config=" + config +
", arch='" + arch + '\'' +
", comment='" + comment + '\'' +
", author='" + author + '\'' +
", os='" + os + '\'' +
'}';
return ToStringBuilder.reflectionToString(this);
}
}