@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof HostConfig.Bind) { HostConfig.Bind that = (HostConfig.Bind) o; return (this.to.equals(that.to())) && (this.from.equals(that.from())) && (this.readOnly.equals(that.readOnly())) && ((this.noCopy == null) ? (that.noCopy() == null) : this.noCopy.equals(that.noCopy())) && ((this.selinuxLabeling == null) ? (that.selinuxLabeling() == null) : this.selinuxLabeling.equals(that.selinuxLabeling())); } return false; }
@SuppressFBWarnings("NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE") public String toString() { if (isNullOrEmpty(to())) { return ""; } else if (isNullOrEmpty(from())) { return to(); } final String bind = from() + ":" + to(); final List<String> options = new ArrayList<>(); if (readOnly()) { options.add("ro"); } //noinspection ConstantConditions if (noCopy() != null && noCopy()) { options.add("nocopy"); } if (selinuxLabeling() != null) { // shared if (Boolean.TRUE.equals(selinuxLabeling())) { options.add("z"); } else { options.add("Z"); } } final String optionsValue = Joiner.on(',').join(options); return (optionsValue.isEmpty()) ? bind : bind + ":" + optionsValue; }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof HostConfig.Bind) { HostConfig.Bind that = (HostConfig.Bind) o; return (this.to.equals(that.to())) && (this.from.equals(that.from())) && (this.readOnly.equals(that.readOnly())) && ((this.noCopy == null) ? (that.noCopy() == null) : this.noCopy.equals(that.noCopy())) && ((this.selinuxLabeling == null) ? (that.selinuxLabeling() == null) : this.selinuxLabeling.equals(that.selinuxLabeling())); } return false; }
@SuppressFBWarnings("NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE") public String toString() { if (isNullOrEmpty(to())) { return ""; } else if (isNullOrEmpty(from())) { return to(); } final String bind = from() + ":" + to(); final List<String> options = new ArrayList<>(); if (readOnly()) { options.add("ro"); } //noinspection ConstantConditions if (noCopy() != null && noCopy()) { options.add("nocopy"); } if (selinuxLabeling() != null) { // shared if (Boolean.TRUE.equals(selinuxLabeling())) { options.add("z"); } else { options.add("Z"); } } final String optionsValue = Joiner.on(',').join(options); return (optionsValue.isEmpty()) ? bind : bind + ":" + optionsValue; }
Builder(HostConfig.Bind source) { this.to = source.to(); this.from = source.from(); this.readOnly = source.readOnly(); this.noCopy = source.noCopy(); this.selinuxLabeling = source.selinuxLabeling(); } @Override
Builder(HostConfig.Bind source) { this.to = source.to(); this.from = source.from(); this.readOnly = source.readOnly(); this.noCopy = source.noCopy(); this.selinuxLabeling = source.selinuxLabeling(); } @Override