use of lombok.NonNull in project blade by biezhi.
the class HttpResponse method removeCookie.
@Override
public Response removeCookie(@NonNull String name) {
Optional<Cookie> cookieOpt = this.cookies.stream().filter(cookie -> cookie.name().equals(name)).findFirst();
cookieOpt.ifPresent(cookie -> {
cookie.setValue("");
cookie.setMaxAge(-1);
});
Cookie nettyCookie = new io.netty.handler.codec.http.cookie.DefaultCookie(name, "");
nettyCookie.setMaxAge(-1);
this.cookies.add(nettyCookie);
return this;
}
use of lombok.NonNull in project open-kilda by telstra.
the class CommandBuilderImpl method makeMirrorConfig.
private MirrorConfig makeMirrorConfig(@NonNull FlowPath flowPath, @NonNull SwitchId mirrorSwitchId, int mirrorPort) {
MirrorConfig mirrorConfig = null;
FlowMirrorPoints flowMirrorPoints = flowPath.getFlowMirrorPointsSet().stream().filter(mirrorPoints -> mirrorSwitchId.equals(mirrorPoints.getMirrorSwitchId())).findFirst().orElse(null);
if (flowMirrorPoints != null) {
Set<MirrorConfigData> mirrorConfigDataSet = flowMirrorPoints.getMirrorPaths().stream().map(mirrorPath -> new MirrorConfigData(mirrorPath.getEgressPort(), mirrorPath.getEgressOuterVlan())).collect(Collectors.toSet());
if (!mirrorConfigDataSet.isEmpty()) {
mirrorConfig = MirrorConfig.builder().groupId(flowMirrorPoints.getMirrorGroupId()).flowPort(mirrorPort).mirrorConfigDataSet(mirrorConfigDataSet).build();
}
}
return mirrorConfig;
}
Aggregations