优化代码。
This commit is contained in:
parent
33b271ddbe
commit
245c31bdce
2
pom.xml
2
pom.xml
@ -45,6 +45,8 @@
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<!-- Test dependencies -->
|
||||
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
|
@ -20,7 +20,6 @@ import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
@ -60,10 +59,9 @@ public class PagingAndSortingQueryParams {
|
||||
public PagingAndSortingQueryParams(Map<String, String> sortableProperties) {
|
||||
Preconditions.checkArgument(sortableProperties != null && !sortableProperties.isEmpty(),
|
||||
"Sortable properties can not be empty.");
|
||||
for (Entry<String, String> p : sortableProperties.entrySet()) {
|
||||
Preconditions.checkArgument(StringUtils.isNotBlank(p.getKey()) && StringUtils.isNotBlank(p.getValue()),
|
||||
"Property name must not be blank.");
|
||||
}
|
||||
sortableProperties.forEach((k, v) ->
|
||||
Preconditions.checkArgument(StringUtils.isNotBlank(k) && StringUtils.isNotBlank(v),
|
||||
"Property name must not be blank."));
|
||||
this.sortableProperties = ImmutableMap.copyOf(sortableProperties);
|
||||
}
|
||||
|
||||
|
@ -124,10 +124,8 @@ class MenuList extends Menu {
|
||||
}
|
||||
|
||||
static MenuList of(String parentMenuCode, String menuCode, String title, Iterable<Menu> children, int orderNum) {
|
||||
MenuList instance = of(parentMenuCode, menuCode, title, orderNum);
|
||||
for (Menu child : children) {
|
||||
instance.addChild(child);
|
||||
}
|
||||
final MenuList instance = of(parentMenuCode, menuCode, title, orderNum);
|
||||
children.forEach(instance::addChild);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user