1515import java .util .List ;
1616import java .util .Map ;
1717
18- import static com . google . common . base . Preconditions . checkNotNull ;
18+ import static java . util . Objects . requireNonNull ;
1919
2020/**
2121 * Used in `/containers/create`, and in inspect container.
@@ -573,13 +573,13 @@ public HostConfig withBinds(Binds binds) {
573573 }
574574
575575 public HostConfig withBinds (Bind ... binds ) {
576- checkNotNull (binds , "binds was not specified" );
576+ requireNonNull (binds , "binds was not specified" );
577577 setBinds (binds );
578578 return this ;
579579 }
580580
581581 public HostConfig withBinds (List <Bind > binds ) {
582- checkNotNull (binds , "binds was not specified" );
582+ requireNonNull (binds , "binds was not specified" );
583583 return withBinds (binds .toArray (new Bind [binds .size ()]));
584584 }
585585
@@ -712,7 +712,7 @@ public HostConfig withDevices(Device... devices) {
712712 }
713713
714714 public HostConfig withDevices (List <Device > devices ) {
715- checkNotNull (devices , "devices was not specified" );
715+ requireNonNull (devices , "devices was not specified" );
716716 return withDevices (devices .toArray (new Device [0 ]));
717717 }
718718
@@ -733,7 +733,7 @@ public HostConfig withDns(String... dns) {
733733 }
734734
735735 public HostConfig withDns (List <String > dns ) {
736- checkNotNull (dns , "dns was not specified" );
736+ requireNonNull (dns , "dns was not specified" );
737737 return withDns (dns .toArray (new String [0 ]));
738738 }
739739
@@ -746,7 +746,7 @@ public HostConfig withDnsSearch(String... dnsSearch) {
746746 }
747747
748748 public HostConfig withDnsSearch (List <String > dnsSearch ) {
749- checkNotNull (dnsSearch , "dnsSearch was not specified" );
749+ requireNonNull (dnsSearch , "dnsSearch was not specified" );
750750 return withDnsSearch (dnsSearch .toArray (new String [0 ]));
751751 }
752752
@@ -775,13 +775,13 @@ public HostConfig withLinks(Links links) {
775775 }
776776
777777 public HostConfig withLinks (Link ... links ) {
778- checkNotNull (links , "links was not specified" );
778+ requireNonNull (links , "links was not specified" );
779779 setLinks (links );
780780 return this ;
781781 }
782782
783783 public HostConfig withLinks (List <Link > links ) {
784- checkNotNull (links , "links was not specified" );
784+ requireNonNull (links , "links was not specified" );
785785 return withLinks (links .toArray (new Link [0 ]));
786786 }
787787
@@ -894,13 +894,13 @@ public HostConfig withPortBindings(Ports portBindings) {
894894 }
895895
896896 public HostConfig withPortBindings (PortBinding ... portBindings ) {
897- checkNotNull (portBindings , "portBindings was not specified" );
897+ requireNonNull (portBindings , "portBindings was not specified" );
898898 withPortBindings (new Ports (portBindings ));
899899 return this ;
900900 }
901901
902902 public HostConfig withPortBindings (List <PortBinding > portBindings ) {
903- checkNotNull (portBindings , "portBindings was not specified" );
903+ requireNonNull (portBindings , "portBindings was not specified" );
904904 return withPortBindings (portBindings .toArray (new PortBinding [0 ]));
905905 }
906906
@@ -985,7 +985,7 @@ public HostConfig withUlimits(Ulimit[] ulimits) {
985985 }
986986
987987 public HostConfig withUlimits (List <Ulimit > ulimits ) {
988- checkNotNull (ulimits , "no ulimits was specified" );
988+ requireNonNull (ulimits , "no ulimits was specified" );
989989 return withUlimits (ulimits .toArray (new Ulimit [0 ]));
990990 }
991991
@@ -1006,7 +1006,7 @@ public HostConfig withVolumesFrom(VolumesFrom... volumesFrom) {
10061006 }
10071007
10081008 public HostConfig withVolumesFrom (List <VolumesFrom > volumesFrom ) {
1009- checkNotNull (volumesFrom , "volumesFrom was not specified" );
1009+ requireNonNull (volumesFrom , "volumesFrom was not specified" );
10101010 return withVolumesFrom (volumesFrom .toArray (new VolumesFrom [0 ]));
10111011 }
10121012
0 commit comments