我有一个地图,其中值是字符串,键是列表:Map<String, List<BoMLine>> materials.我想用它的值过滤这个地图; 这样的事情:
materials.entrySet().stream()
.filter(a->a.getValue().stream()
.filter(l->MaterialDao.findMaterialByName(l.getMaterial()).ispresent)
Run Code Online (Sandbox Code Playgroud)
但这对我不起作用.有人有想法吗?
谢谢.
我有android checkBox,默认背景是透明的,我希望它是白色所以我使用样式:
<style name="BrandedCheckBox" parent="AppTheme">
<item name="colorAccent">@color/cyan</item>
<item name="colorControlNormal">@color/text_gray</item>
<item name="colorControlActivated">@color/cyan</item>
</style>
Run Code Online (Sandbox Code Playgroud)
并设置checkBox主题:
<CheckBox
android:id="@+id/check_payable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_gravity="center"
android:theme="@style/BrandedCheckBox"/>
Run Code Online (Sandbox Code Playgroud)
谁可以帮我这个事?
我是Android新手,我的应用中有一个按钮:
<Button android:elevation="10dp"
android:id="@+id/btnAddJob"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="@drawable/round_btn"
android:drawableLeft="@drawable/plus"
android:paddingLeft="9dp"
android:gravity="center"
android:layout_marginLeft="300dp" />
Run Code Online (Sandbox Code Playgroud)
和round_btn:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="oval" android:thickness="24dp" >
<stroke android:color="@color/colorText" android:width="24dp" />
<solid android:color="@color/colorText"/>
<size android:width="150dp" android:height="150dp"/>
</shape>
</item>
Run Code Online (Sandbox Code Playgroud)
问题是我希望它具有阴影,因此按钮似乎比其他元素高。有人可以帮忙吗?
我试图在websocket的open方法中获取用户ID,为此我使用的是shiro,但是对于Subject,我得到null,这是我的方法:
@OnOpen
public void open(final Session session, @PathParam("room") final String room) {
Subject currentUser = SecurityUtils.getSubject();
long id = currentUser.getPrincipals().oneByType(model.Users.class)
.getId();
log.info("session openend and bound to room: " + room);
session.getUserProperties().put("user", id);
}
Run Code Online (Sandbox Code Playgroud)
有人知道我应该怎么做吗?
我有这个泛型列表List<? super Domain>,包含Domain:Material和BoM的实现,现在我想分别得到每个实体.
domainList.stream().filter(a -> a.getClass().equals(BoM.class))
.collect(Collectors.toList());
Run Code Online (Sandbox Code Playgroud)
用这行我List<? super Domain>只有包含BoM对象.我的问题是如何将此列表转换为List<BoM>?