﻿{"id":699,"date":"2013-04-19T00:26:26","date_gmt":"2013-04-18T15:26:26","guid":{"rendered":"http:\/\/yucchi.jp\/blog\/?p=699"},"modified":"2013-04-24T19:15:23","modified_gmt":"2013-04-24T10:15:23","slug":"%e3%82%82%e3%81%a3%e3%81%a8-lambda%e3%80%80%e3%81%9d%e3%81%ae%ef%bc%92","status":"publish","type":"post","link":"http:\/\/yucchi.jp\/blog\/?p=699","title":{"rendered":"\u3082\u3063\u3068 Lambda\u3000\u305d\u306e\uff12"},"content":{"rendered":"<p>\u4eca\u65e5\u3082 Java8 \u306e\u65b0\u6a5f\u80fd\u306b\u6163\u308c\u308b\u3079\u304f\u30cd\u30c3\u30c8\u304b\u3089\u60c5\u5831\u53ce\u96c6\u3057\u305f\u3082\u306e\u3092\u8a66\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306e\u60c5\u5831\u6e90\u3082\u5916\u56fd\u8a9e\u306e\u30b5\u30a4\u30c8\u306a\u306e\u3067\u8a73\u3057\u3044\u3053\u3068\u306f\u7406\u89e3\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u304c\u96f0\u56f2\u6c17\u3060\u3051\u3067\u3082\u611f\u3058\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002\uff08\u306a\u3093\u306e\u3053\u3063\u3061\u3083\uff1f<\/p>\n<p>\u3063\u3066\u306a\u8a33\u3067\u4eca\u56de\u306f\u300cJDK8 Lambda \u305d\u306e\u4ed6\u3044\u308d\u3044\u308d \u306a\u3093\u3067\u3082\u3044\u3044\u304b\u3089\u52d5\u304b\u3057\u3066\u307f\u308b\u300d\u30b7\u30ea\u30fc\u30ba\u3067\u3082\u304a\u99b4\u67d3\u307f\u306e Optional \u3067\u3059\u3002<\/p>\n<p>\u524d\u306f\u30b9\u30c8\u30ea\u30fc\u30e0\u3067\u30b4\u30cb\u30e7\u30b4\u30cb\u30e7\u3057\u3066\u3044\u305f\u306e\u3067\u4eca\u56de\u306f\u7d20\u306e\u307e\u307e\u3067\u3002<\/p>\n<p>\u30b7\u30f3\u30d7\u30eb\u306a\u30b3\u30fc\u30c9\u306a\u306e\u3067\u3060\u3044\u305f\u3044\u306e\u3053\u3068\u306f\u89e3\u308b\u3088\u3046\u306a\u6c17\u304c\u3057\u307e\u3059\u3002<\/p>\n<style type=\"text\/css\">\n<!--\ntable {color: #000000; background-color: #e9e8e2; font-family: \u3086\u305f\u307d\u3093\uff08\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\uff09}\n-->\n<\/style>\n<table width=\"100%\">\n<tbody>\n<tr>\n<td align=\"left\">mylambdaexamples_2\\Person.java<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre>\r\npackage mylambdaexamples_2;\r\n\r\nimport java.time.LocalDate;\r\nimport java.time.Period;\r\n\r\npublic class Person {\r\n\r\n    public enum Sex {\r\n\r\n        MALE, FEMALE\r\n    }\r\n    String firstName;\r\n    String lastName;\r\n    LocalDate birthday;\r\n    Sex gender;\r\n\r\n    public Person(String firstName, String lastName, LocalDate birthday, Sex gender) {\r\n        this.firstName = firstName;\r\n        this.lastName = lastName;\r\n        this.birthday = birthday;\r\n        this.gender = gender;\r\n    }\r\n\r\n    public String getFirstName() {\r\n        return firstName;\r\n    }\r\n\r\n    public String getLastName() {\r\n        return lastName;\r\n    }\r\n\r\n    public Sex getGender() {\r\n        return gender;\r\n    }\r\n\r\n    public int getAge() {\r\n        return Period.between(birthday, LocalDate.now()).getYears();\r\n    }\r\n\r\n    void printPerson() {\r\n        System.out.println(firstName + \" \" + lastName + \", \" + this.getAge() + \"\u6b73\" + \", Gender: \"\r\n                + this.getGender());\r\n    }\r\n}\r\n\r\n<\/pre>\n<style type=\"text\/css\">\n<!--\ntable {color: #000000; background-color: #e9e8e2; font-family: \u3086\u305f\u307d\u3093\uff08\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\uff09}\n-->\n<\/style>\n<table width=\"100%\">\n<tbody>\n<tr>\n<td align=\"left\">mylambdaexamples_2\\MyLambdaExamples_2.java<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre>\r\npackage mylambdaexamples_2;\r\n\r\nimport java.time.LocalDate;\r\nimport java.util.ArrayList;\r\nimport java.util.List;\r\nimport java.util.Optional;\r\nimport java.util.function.Consumer;\r\n\r\npublic class MyLambdaExamples_2 {\r\n\r\n    public static void main(String[] args) {\r\n        List<Person> person = new ArrayList<>();\r\n        person.add(new Person(\"\u67f4\u7530\", \"\u606d\u5e73\", LocalDate.of(1951, 8, 18), Person.Sex.MALE));\r\n        person.add(new Person(\"\u58c7\", \"\u871c\", LocalDate.of(1980, 12, 3), Person.Sex.FEMALE));\r\n        person.add(new Person(\"\u5317\u5ddd\", \"\u666f\u5b50\", LocalDate.of(1986, 8, 22), Person.Sex.FEMALE));\r\n        person.add(new Person(\"\u7dbe\u702c\", \"\u306f\u308b\u304b\", LocalDate.of(1985, 3, 24), Person.Sex.FEMALE));\r\n        person.add(new Person(\"\u4f50\u3005\u6728\", \"\u5e0c\", LocalDate.of(1988, 2, 8), Person.Sex.FEMALE));\r\n        person.add(new Person(\"\u525b\u529b\", \"\u5f69\u82bd\", LocalDate.of(1992, 8, 27), Person.Sex.FEMALE));\r\n        person.add(new Person(\"\u5c0f\u6817\", \"\u65ec\", LocalDate.of(1982, 12, 26), Person.Sex.MALE));\r\n        person.add(new Person(\"\u5800\u5317\", \"\u771f\u5e0c\", LocalDate.of(1988, 10, 6), Person.Sex.FEMALE));\r\n        person.add(new Person(\"\u6b66\u4e95\", \"\u54b2\", LocalDate.of(1993, 12, 25), Person.Sex.FEMALE));\r\n        person.add(new Person(\"\u5e02\u539f\", \"\u96bc\u4eba\", LocalDate.of(1987, 2, 6), Person.Sex.MALE));\r\n        person.add(new Person(\"\u6df1\u7530\", \"\u606d\u5b50\", LocalDate.of(1982, 11, 2), Person.Sex.FEMALE));\r\n\r\n        \/\/ Person \u8868\u793a\r\n        System.out.println(\"\\n<-- Person \u8868\u793a -->\");\r\n        person.forEach(e -> {\r\n            e.printPerson();\r\n        });\r\n        \r\n        \/\/ \u307f\u3063\u3051\r\n        Optional<Person> found = find(\"\u306f\u308b\u304b\", person);\r\n        found.ifPresent(f -> {\r\n            System.out.println(f.getLastName());\r\n        });\r\n        \r\n        \/\/ \u3044\u306a\u3044\r\n        Optional<Person> found2 = find(\"\u306f\u308b\", person);\r\n        System.out.println(found2.orElse(new Person(\"\u540d\u7121\u3057\u306e\", \"\u6a29\u5175\u885b\", LocalDate.of(2013, 4, 1), Person.Sex.MALE)).getLastName());\r\n        \r\n        \/\/ \u3044\u306a\u3044\r\n        Optional<Person> found3 = find(\"\u308b\u304b\", person);\r\n        System.out.println(found3.orElseGet(() -> {\r\n            return new Person(\"\u65e5\u672c\", \"\u592a\u90ce\", LocalDate.of(2002, 4, 18), Person.Sex.MALE);\r\n        }).getLastName());\r\n    }\r\n\r\n    private static Optional<Person> find(String lastName, List<Person> person) {\r\n        for (Person persons : person) {\r\n            if (persons.getLastName().equals(lastName)) {\r\n                System.out.println(\"\\n\u307f\u3063\u3051\");\r\n                return Optional.of(persons);\r\n            }\r\n        }\r\n        System.out.println(\"\\n\u3044\u306a\u3044\");\r\n        return Optional.empty();\r\n    }\r\n\r\n}\r\n\r\n\r\n<\/pre>\n<p>\u4eca\u56de\u307e\u305f\u898b\u6163\u308c\u306a\u3044\u30e1\u30bd\u30c3\u30c9\u304c\u3067\u3066\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>JavaDoc \u3092\u3061\u3089\u3063\u3068\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><font color=\"#ff0000\" size=\"4\"><strong>ifPresent()<\/strong><\/font><\/p>\n<p><b><a href=\"about:blank*0\" target=\"_blank\">java.\u200butil.\u200bOptional<\/a><\/b> <\/p>\n<p><tt>public void <b>ifPresent<\/b>(<a href=\"about:blank*1\" target=\"_blank\">Consumer<\/a>&lt;? super T&gt; consumer)<\/tt> <\/p>\n<p>Have the specified consumer accept the value if a value is present, otherwise do nothing. <\/p>\n<p><b>\u30d1\u30e9\u30e1\u30fc\u30bf:<\/b> <\/p>\n<blockquote><p><code>consumer<\/code> &#8211; block to be executed if a value is present<\/p><\/blockquote>\n<p><b>\u30b9\u30ed\u30fc:<\/b> <\/p>\n<blockquote>\n<p><code>NullPointerException<\/code> &#8211; if value is present and <code>consumer<\/code> is null<\/p>\n<\/blockquote>\n<p>\u6307\u5b9a\u3055\u308c\u305f consumer \u304c\u3001\u3082\u3057\u5024\u304c\u5b58\u5728\u3057\u3066\u3044\u308b\u306a\u3089\u3001\u5024\u3092\u53d7\u3051\u3068\u3063\u3066\u3001\u3055\u3082\u306a\u3051\u308c\u3070\u4f55\u3082\u3057\u306a\u3044\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><b>\u30d1\u30e9\u30e1\u30fc\u30bf: <\/b>\u3082\u3057\u5024\u304c\u5b58\u5728\u3057\u3066\u3044\u308b\u306a\u3089\u3001\u30d6\u30ed\u30c3\u30af\u304c\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><font color=\"#ff0000\" size=\"4\"><strong>orElse()<\/strong><\/font><\/p>\n<p><b><a href=\"about:blank*0\">java.\u200butil.\u200bOptional<\/a><\/b> <\/p>\n<p><tt>public T <b>orElse<\/b>(T other)<\/tt> <\/p>\n<p>Return the value if present, otherwise return <code>other<\/code>. <\/p>\n<p><b>\u30d1\u30e9\u30e1\u30fc\u30bf:<\/b> <\/p>\n<blockquote><p><code>other<\/code> &#8211; the value to be returned if there is no value present, may be null<\/p><\/blockquote>\n<p><b>\u623b\u308a\u5024:<\/b> <\/p>\n<blockquote><p>the value, if present, otherwise <code>other<\/code><\/p><\/blockquote>\n<p>\u5024\u304c\u5b58\u5728\u3059\u308b\u306a\u3089\u3070\u305d\u308c\u3092\u3001\u5b58\u5728\u3057\u306a\u3044\u306a\u3089\u4ed6\u3092<\/p>\n<p><b>\u30d1\u30e9\u30e1\u30fc\u30bf: <\/b>\u4ed6\u306e\u5024\u304c\u5b58\u5728\u3057\u306a\u3044\u5834\u5408\u8fd4\u3055\u308c\u308b\u5024\u306f null \u304b\u3082\u3057\u308c\u306a\u3044\u3002<\/p>\n<p>\u3044\u3064\u3082\u306e\u3053\u3068\u3060\u3051\u3069\u7ffb\u8a33\u652f\u63f4\u30bd\u30d5\u30c8\u3063\u3066\u5fae\u5999\u30fb\u30fb\u30fb<\/p>\n<p>&nbsp;<\/p>\n<p><font color=\"#ff0000\" size=\"4\"><strong>orElseGet()<\/strong><\/font><\/p>\n<p><b><a href=\"about:blank*0\" target=\"_blank\">java.\u200butil.\u200bOptional<\/a><\/b> <\/p>\n<p><tt>public T <b>orElseGet<\/b>(<a href=\"about:blank*1\" target=\"_blank\">Supplier<\/a>&lt;? extends T&gt; other)<\/tt> <\/p>\n<p>Return the value if present, otherwise invoke <code>other<\/code> and return the result of that invocation. <\/p>\n<p><b>\u30d1\u30e9\u30e1\u30fc\u30bf:<\/b> <\/p>\n<blockquote><p><code>other<\/code> &#8211; a <code>Supplier<\/code> whose result is returned if no value is present<\/p><\/blockquote>\n<p><b>\u623b\u308a\u5024:<\/b> <\/p>\n<blockquote><p>the value if present otherwise the result of <code>other.get()<\/code><\/p><\/blockquote>\n<p><b>\u30b9\u30ed\u30fc:<\/b> <\/p>\n<blockquote>\n<p><code>NullPointerException<\/code> &#8211; if value is not present and <code>other<\/code> is null <\/p>\n<\/blockquote>\n<p>\u3082\u3057\u5b58\u5728\u3057\u3066\u3044\u308b\u306a\u3089\u3001\u5024\u3092\u8fd4\u3057\u3066\u3001\u3055\u3082\u306a\u3051\u308c\u3070other\u3092\u547c\u3073\u51fa\u3057\u3066\u3001\u305d\u3057\u3066\u305d\u306e\u547c\u51fa\u3057\u306e\u7d50\u679c\u3092\u8fd4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><b>\u30d1\u30e9\u30e1\u30fc\u30bf: <\/b>\u5024\u3067\u306f\u306a\u304f\u3001\u305d\u306e\u7d50\u679c\u304c\u8fd4\u3055\u308c\u308b\u30b5\u30d7\u30e9\u30a4\u30e4\u304c\u5b58\u5728\u3057\u3066\u3044\u307e\u3059<\/p>\n<p>&nbsp;<\/p>\n<p><font color=\"#ff0000\" size=\"4\"><strong>of()<\/strong><\/font><\/p>\n<p><b><a href=\"about:blank*0\" target=\"_blank\">java.\u200butil.\u200bOptional<\/a><\/b> <\/p>\n<p><tt>public static &lt;T&gt; <a href=\"about:blank*1\" target=\"_blank\">Optional<\/a>&lt;T&gt; <b>of<\/b>(T value)<\/tt> <\/p>\n<p>Return an <code>Optional<\/code> with the specified present value. <\/p>\n<p><b>\u30d1\u30e9\u30e1\u30fc\u30bf:<\/b> <\/p>\n<blockquote><p><code>value<\/code> &#8211; the value to be present, which must be non-null<\/p><\/blockquote>\n<p><b>\u623b\u308a\u5024:<\/b> <\/p>\n<blockquote>\n<p>an <code>Optional<\/code> with the value present <\/p>\n<\/blockquote>\n<p>\u6307\u5b9a\u3055\u308c\u305f\u73fe\u5728\u306e\u5024\u3067\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u8fd4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><b>\u30d1\u30e9\u30e1\u30fc\u30bf: <\/b>\u5024\u304c\u5b58\u5728\u3057\u3066\u3044\u307e\u3059\u3002\u305d\u308c\u306f null \u3067\u3042\u3063\u3066\u306f\u3044\u3051\u306a\u3044\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><font color=\"#ff0000\" size=\"4\"><strong>empty()<\/strong><\/font><\/p>\n<p><b><a href=\"about:blank*0\" target=\"_blank\">java.\u200butil.\u200bOptional<\/a><\/b> <\/p>\n<p><tt>public static &lt;T&gt; <a href=\"about:blank*1\" target=\"_blank\">Optional<\/a>&lt;T&gt; <b>empty<\/b>()<\/tt> <\/p>\n<p>Returns an empty <code>Optional<\/code> instance. No value is present for this Optional. <\/p>\n<p><b>\u578b\u30d1\u30e9\u30e1\u30fc\u30bf:<\/b> <\/p>\n<blockquote><p><code>T<\/code> &#8211; Type of the non-existent value<\/p><\/blockquote>\n<p><b>\u623b\u308a\u5024:<\/b> <\/p>\n<blockquote>\n<p>an empty <code>Optional<\/code><\/p>\n<\/blockquote>\n<p>\u7a7a\u306e Optional \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u8fd4\u3057\u307e\u3059\u3002 \u5024\u306a\u3057\u306f\u3053\u306e Optional \u306e\u305f\u3081\u306b\u5b58\u5728\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><b>\u578b\u30d1\u30e9\u30e1\u30fc\u30bf: <\/b>\u5b9f\u5728\u3057\u306a\u3044\u5024\u306e\u30bf\u30a4\u30d7<\/p>\n<p>&nbsp;<\/p>\n<p>\u82f1\u8a9e\u3058\u3083\u306a\u304f\u3066\u65e5\u672c\u8a9e\u306e JavaDoc \u304c\u3044\u3044\u306a\u3041\u30fb\u30fb\u30fb<\/p>\n<p>\u4ee5\u4e0a\u306e\u3053\u3068\u3092\u8e0f\u307e\u3048\u3066\u30b3\u30fc\u30c9\u3092\u898b\u3066\u307f\u308b\u3068\u3001\u540d\u524d\u3067\u691c\u7d22\u304b\u3051\u3066\u30d2\u30c3\u30c8\u3057\u305f\u3089\u201d\u307f\u3063\u3051\u201d\u3068\u540d\u524d\u3092\u8868\u793a\u3002<\/p>\n<p>38 \u884c\u76ee\u306e\u691c\u7d22\u3067\u306f\u30d2\u30c3\u30c8\u3057\u306a\u3044\u306e\u3067 \u201d\u3044\u306a\u3044\u201d \u3068 <b>orElse<\/b>(T other) \u306b\u3088\u3063\u3066\u6a29\u5175\u885b\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><b>orElse<\/b>(T other) \u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u3092\u8fd4\u3059\u305f\u3081\u306b\u4f7f\u308f\u308c\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n<p>42 \u884c\u76ee\u306e\u691c\u7d22\u3067\u3082\u30d2\u30c3\u30c8\u3057\u306a\u3044\u306e\u3067 \u201d\u3044\u306a\u3044\u201d \u3068 <b>orElseGet<\/b>(Supplier&lt;? extends T&gt; other) \u306b\u3088\u3063\u3066\u592a\u90ce\u304c\u8868\u793a\u3055\u308c\u308b\u3002<\/p>\n<p><b>orElseGet<\/b>(Supplier&lt;? extends T&gt; other) \u306f\u3001\u3082\u3057 optional \u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u7a7a\u3067\u3042\u308b\u306a\u3089\u3001\u7a76\u6975\u7684\u306b\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u7b54\u3048\u3092\u63d0\u4f9b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u30b5\u30d7\u30e9\u30a4\u30e4\u3092\u63d0\u4f9b\u3059\u308b\u305f\u3081\u306b\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p>\u3061\u3087\u3063\u3068\u9762\u5012\u306a\u4f8b\u5916\u51e6\u7406\u306e\u3088\u3046\u3067\u3059\u306d\u3002<\/p>\n<p>\u3055\u3066\u3001\u3053\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u5b9f\u884c\u7d50\u679c\u3092\u4e00\u5fdc\u8f09\u305b\u3066\u304a\u304d\u307e\u3059\u306d\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;&#8211; Person \u8868\u793a &#8211;&gt;<br \/>\u67f4\u7530 \u606d\u5e73, 61\u6b73, Gender: MALE<br \/>\u58c7 \u871c, 32\u6b73, Gender: FEMALE<br \/>\u5317\u5ddd \u666f\u5b50, 26\u6b73, Gender: FEMALE<br \/>\u7dbe\u702c \u306f\u308b\u304b, 28\u6b73, Gender: FEMALE<br \/>\u4f50\u3005\u6728 \u5e0c, 25\u6b73, Gender: FEMALE<br \/>\u525b\u529b \u5f69\u82bd, 20\u6b73, Gender: FEMALE<br \/>\u5c0f\u6817 \u65ec, 30\u6b73, Gender: MALE<br \/>\u5800\u5317 \u771f\u5e0c, 24\u6b73, Gender: FEMALE<br \/>\u6b66\u4e95 \u54b2, 19\u6b73, Gender: FEMALE<br \/>\u5e02\u539f \u96bc\u4eba, 26\u6b73, Gender: MALE<br \/>\u6df1\u7530 \u606d\u5b50, 30\u6b73, Gender: FEMALE<\/p>\n<p>\u307f\u3063\u3051<br \/>\u306f\u308b\u304b<\/p>\n<p>\u3044\u306a\u3044<br \/>\u6a29\u5175\u885b<\/p>\n<p>\u3044\u306a\u3044<br \/>\u592a\u90ce<\/p>\n<p>\u4eca\u56de\u3082\u672a\u6765\u306e\u7d20\u6575\u306a\u30b3\u30fc\u30c9\u306e\u6b20\u7247\u3092\u8a66\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u82f1\u8a9e\u304c\u826f\u304f\u89e3\u3089\u306a\u3044\u306e\u3067\u4ed5\u7d44\u307f\u304c\u3044\u307e\u3044\u3061\u7406\u89e3\u3067\u304d\u306a\u3044\u306e\u304c\u3061\u3087\u3063\u3068\u6b8b\u5ff5\u3060\u3051\u3069\u3086\u3063\u304f\u308a\u307c\u3061\u307c\u3061\u3068\u697d\u3057\u3093\u3067\u899a\u3048\u3066\u3044\u3053\u3046\uff01(^_^)<\/p>\n<p>\u305d\u308c\u3067\u306f\u304a\u7d04\u675f\u3067\u3059\u3002<\/p>\n<p>\u3053\u306e\u300c\u3082\u3063\u3068 Lambda \u300d\u306f\u3001\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u4e0a\u3067\u5f97\u305f\u60c5\u5831\u3092\u5143\u306b\u305d\u308c\u3092\u5c11\u3057\u5909\u66f4\u3057\u3066\u3044\u308b\u3060\u3051\u3067\u3059\u3002 <\/p>\n<p>\u60b2\u3057\u3044\u3053\u3068\u306b\u305d\u306e\u60c5\u5831\u6e90\u306f\u82f1\u8a9e\u306a\u306e\u3067\u8a73\u3057\u3044\u5185\u5bb9\u306f\u308f\u304b\u308a\u307e\u305b\u3093\u3002 <\/p>\n<p>\u3088\u3063\u3066\u79c1\u306e\u63a8\u6e2c\u3067\u89e3\u91c8\u3055\u308c\u305f\u5185\u5bb9\u3068\u306a\u3063\u3066\u307e\u3059\u306e\u3067\u9593\u9055\u3044\u304c\u3042\u308b\u3068\u601d\u3044\u307e\u3059\u3002 <\/p>\n<p>Java8 \u3082\u307e\u3060 build85 \u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u306e\u3067 API \u306e\u5909\u66f4\u306b\u3088\u308a\u8a18\u8ff0\u65b9\u6cd5\u304c\u5909\u308f\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002 <\/p>\n<p>\u65e9\u304f\u6b63\u5f0f\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u3066\u65e5\u672c\u8a9e\u3067\u3053\u306e\u8d85\u4fbf\u5229\u3067\u7d20\u6575\u306a\u65b0\u6a5f\u80fd\u3092\u52c9\u5f37\u3057\u305f\u3044\u4eca\u65e5\u3053\u306e\u9803\u3067\u3059\u3002 <\/p>\n<p>&nbsp;<\/p>\n<div id=\"scid:0767317B-992E-4b12-91E0-4F059A8CECA8:4040a916-83d5-4d48-9bd8-dabe1125967f\" class=\"wlWriterEditableSmartContent\" style=\"float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px\">Hatena \u30bf\u30b0: <a href=\"http:\/\/b.hatena.ne.jp\/t\/Java\" rel=\"tag\">Java<\/a><\/div>\n<div class='wp_social_bookmarking_light'>\n            <div class=\"wsbl_hatena\"><a href='\/\/b.hatena.ne.jp\/add?mode=confirm&url=http%3A%2F%2Fyucchi.jp%2Fblog%2F%3Fp%3D699&title=%E3%82%82%E3%81%A3%E3%81%A8%20Lambda%E3%80%80%E3%81%9D%E3%81%AE%EF%BC%92' title='\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0' rel=nofollow class='wp_social_bookmarking_light_a' target=_blank><img src='http:\/\/yucchi.jp\/blog\/wp-content\/plugins\/wp-social-bookmarking-light\/public\/images\/hatena.gif' alt='\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0' title='\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0' width='16' height='12' class='wp_social_bookmarking_light_img' \/><\/a><\/div>\n            <div class=\"wsbl_facebook\"><a href='http:\/\/www.facebook.com\/share.php?u=http%3A%2F%2Fyucchi.jp%2Fblog%2F%3Fp%3D699&t=%E3%82%82%E3%81%A3%E3%81%A8%20Lambda%E3%80%80%E3%81%9D%E3%81%AE%EF%BC%92' title='Facebook \u306b\u30b7\u30a7\u30a2' rel=nofollow class='wp_social_bookmarking_light_a' target=_blank><img src='http:\/\/yucchi.jp\/blog\/wp-content\/plugins\/wp-social-bookmarking-light\/public\/images\/facebook.png' alt='Facebook \u306b\u30b7\u30a7\u30a2' title='Facebook \u306b\u30b7\u30a7\u30a2' width='16' height='16' class='wp_social_bookmarking_light_img' \/><\/a><\/div>\n            <div class=\"wsbl_google_plus_one\"><g:plusone size=\"medium\" annotation=\"none\" href=\"http:\/\/yucchi.jp\/blog\/?p=699\" ><\/g:plusone><\/div>\n            <div class=\"wsbl_twitter\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-url=\"http:\/\/yucchi.jp\/blog\/?p=699\" data-text=\"\u3082\u3063\u3068 Lambda\u3000\u305d\u306e\uff12\" data-lang=\"ja\">Tweet<\/a><\/div>\n    <\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u65e5\u3082 Java8 \u306e\u65b0\u6a5f\u80fd\u306b\u6163\u308c\u308b\u3079\u304f\u30cd\u30c3\u30c8\u304b\u3089\u60c5\u5831\u53ce\u96c6\u3057\u305f\u3082\u306e\u3092\u8a66\u3057\u3066\u307f\u307e\u3059\u3002 \u4eca\u56de\u306e\u60c5\u5831\u6e90\u3082\u5916\u56fd\u8a9e\u306e\u30b5\u30a4\u30c8\u306a\u306e\u3067\u8a73\u3057\u3044\u3053\u3068\u306f\u7406\u89e3\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u304c\u96f0\u56f2\u6c17\u3060\u3051\u3067\u3082\u611f\u3058\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002\uff08\u306a\u3093\u306e\u3053\u3063\u3061\u3083\uff1f \u3063\u3066\u306a\u8a33\u3067\u4eca\u56de\u306f\u300cJDK8 Lambda \u305d\u306e\u4ed6\u3044\u308d\u3044\u308d \u306a\u3093\u3067\u3082\u3044\u3044\u304b\u3089\u52d5\u304b\u3057\u3066\u307f\u308b\u300d\u30b7\u30ea\u30fc\u30ba\u3067\u3082\u304a\u99b4\u67d3\u307f\u306e Optional \u3067\u3059\u3002 \u524d\u306f\u30b9\u30c8\u30ea\u30fc\u30e0\u3067\u30b4\u30cb\u30e7\u30b4\u30cb\u30e7\u3057\u3066\u3044\u305f\u306e\u3067\u4eca\u56de\u306f\u7d20\u306e\u307e\u307e\u3067\u3002 \u30b7\u30f3\u30d7\u30eb\u306a\u30b3\u30fc\u30c9\u306a\u306e\u3067\u3060\u3044\u305f\u3044\u306e\u3053\u3068\u306f\u89e3\u308b\u3088\u3046\u306a\u6c17\u304c\u3057\u307e\u3059\u3002 mylambdaexamples_2\\Person.java package mylambdaexamples_2; import\u2026<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[17],"class_list":["post-699","post","type-post","status-publish","format-standard","hentry","category-java","tag-java"],"_links":{"self":[{"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/699","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=699"}],"version-history":[{"count":3,"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/699\/revisions"}],"predecessor-version":[{"id":776,"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/699\/revisions\/776"}],"wp:attachment":[{"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=699"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=699"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=699"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}