@@ -23,19 +23,19 @@ public StackHost(String hostName) {
2323 }
2424
2525 public Optional <String > getProto () {
26- return proto ;
26+ return proto . filter ( p -> ! p . isBlank ()) ;
2727 }
2828
2929 public Optional <String > getName () {
30- return name ;
30+ return name . filter ( n -> ! n . isBlank ()) ;
3131 }
3232
3333 public Optional <String > getPort () {
34- return port ;
34+ return port . filter ( p -> ! p . isBlank ()) ;
3535 }
3636
3737 public Optional <String > getPath () {
38- return path ;
38+ return path . filter ( p -> ! p . isBlank ()) ;
3939 }
4040
4141 public Builder getStringBuilder () {
@@ -52,42 +52,42 @@ public class Builder {
5252 private boolean finalSlash = false ;
5353
5454 public Builder withProto () {
55- proto .ifPresent (p -> protoOut = p );
55+ getProto () .ifPresent (p -> protoOut = p );
5656 return this ;
5757 }
5858
5959 public Builder withProto (String defaultProto ) {
60- protoOut = proto .orElse (defaultProto );
60+ protoOut = getProto () .orElse (defaultProto );
6161 return this ;
6262 }
6363
6464 public Builder withName () {
65- name .ifPresent (n -> nameOut = n );
65+ getName () .ifPresent (n -> nameOut = n );
6666 return this ;
6767 }
6868
6969 public Builder withName (String defaultName ) {
70- nameOut = name .orElse (defaultName );
70+ nameOut = getName () .orElse (defaultName );
7171 return this ;
7272 }
7373
7474 public Builder withPort () {
75- port .ifPresent (p -> portOut = p );
75+ getPort () .ifPresent (p -> portOut = p );
7676 return this ;
7777 }
7878
7979 public Builder withPort (String defaultPort ) {
80- portOut = port .orElse (defaultPort );
80+ portOut = getPort () .orElse (defaultPort );
8181 return this ;
8282 }
8383
8484 public Builder withPath () {
85- path .ifPresent (p -> pathOut = p );
85+ getPath () .ifPresent (p -> pathOut = p );
8686 return this ;
8787 }
8888
8989 public Builder withPath (String defaultPath ) {
90- pathOut = path .orElse (defaultPath );
90+ pathOut = getPath () .orElse (defaultPath );
9191 return this ;
9292 }
9393
0 commit comments