Skip to content

Commit 6f2800f

Browse files
javier-godoymlopezFC
authored andcommitted
refactor: avoid use of commons.lang3
Close #174
1 parent 5ca84fb commit 6f2800f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/main/java/com/flowingcode/vaadin/addons/googlemaps/GoogleMap.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
import java.util.List;
4848
import java.util.concurrent.CompletableFuture;
4949
import lombok.experimental.ExtensionMethod;
50-
import org.apache.commons.lang3.StringUtils;
5150

5251
@SuppressWarnings("serial")
5352
@Tag("google-map")
@@ -83,14 +82,18 @@ public enum MapType {
8382
*/
8483
public GoogleMap(String apiKey, String clientId, String language) {
8584
getElement().setAttribute("api-key", apiKey);
86-
if (!StringUtils.isEmpty(clientId)) {
85+
if (!isEmpty(clientId)) {
8786
getElement().setAttribute("client-id", clientId);
8887
}
89-
if (!StringUtils.isEmpty(language)) {
88+
if (!isEmpty(language)) {
9089
getElement().setAttribute("language", language);
9190
}
9291
}
9392

93+
private static boolean isEmpty(final String s) {
94+
return s == null || s.length() == 0;
95+
}
96+
9497
@Synchronize("google-map-idle")
9598
public Double getLatitude() {
9699
return getElement().getProperty("latitude", 0d);

0 commit comments

Comments
 (0)