<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>nainaistar</author_name>
  <author_url>https://blog.hatena.ne.jp/nainaistar/</author_url>
  <blog_title>きり丸の技術日記</blog_title>
  <blog_url>https://nainaistar.hatenablog.com/</blog_url>
  <categories>
    <anon>Java</anon>
    <anon>技術</anon>
  </categories>
  <description>私はラムダ式での可読性を上げるため、メソッド参照を使用することが多いです。ただ、メソッド参照を使用したまま条件否定する方法を知らなかったため、無名関数を使用して条件を否定していました。または、内部で条件否定をしたメソッドを別に用意していることもありました。 今回、メソッド参照を使用したまま条件否定する方法を知ったので、それを残します。 環境 Java 17 対応 Predicate.notを使用する。 次のコードは、日本円の商品以外の合計を取得するコードです。 public record Currency(String unit, int value) { public boolean isJ…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fnainaistar.hatenablog.com%2Fentry%2F2022%2F05%2F30%2F120000&quot; title=&quot;Javaでメソッド参照を使ったまま、ラムダ式で条件否定をする（Predicate.not） - きり丸の技術日記&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/n/nainaistar/20220417/20220417170043.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2022-05-30 12:00:00</published>
  <title>Javaでメソッド参照を使ったまま、ラムダ式で条件否定をする（Predicate.not）</title>
  <type>rich</type>
  <url>https://nainaistar.hatenablog.com/entry/2022/05/30/120000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
