@Test public void builderWithoutDoesRemoveParam() { PlaceRequest request = new PlaceRequest.Builder() .nameToken("nameToken") .with("name1", "value1") .with("name2", "value2") .build(); PlaceRequest.Builder copyBuilder = new PlaceRequest.Builder(request); PlaceRequest copy = copyBuilder.without("name2").build(); assertNull(copy.getParameter("name2", null)); }
public String getParameter(String key, String defaultValue) { return params.getOrDefault(key, defaultValue); }
PlaceRequest { public String getParameter(String key, String defaultValue) { return params.getOrDefault(key, defaultValue); } }
PlaceRequest { public String getParameter(String key, String defaultValue) { return params.getOrDefault(key, defaultValue); } private  PlaceRequest(String nameToken, Map<String, String> params); }
PlaceRequest { public String getParameter(String key, String defaultValue) { return params.getOrDefault(key, defaultValue); } private  PlaceRequest(String nameToken, Map<String, String> params); String getNameToken(); String getParameter(String key, String defaultValue); Set<String> getParameterNames(); boolean matchesNameToken(PlaceRequest other); boolean matchesNameToken(String nameToken); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); static Builder of(String nameToken); }
PlaceRequest { public String getParameter(String key, String defaultValue) { return params.getOrDefault(key, defaultValue); } private  PlaceRequest(String nameToken, Map<String, String> params); String getNameToken(); String getParameter(String key, String defaultValue); Set<String> getParameterNames(); boolean matchesNameToken(PlaceRequest other); boolean matchesNameToken(String nameToken); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); static Builder of(String nameToken);  }