{"id":293895,"date":"2019-08-27T09:01:52","date_gmt":"2019-08-27T09:01:52","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=293895"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=293895","title":{"rendered":"\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f union \u0442\u0438\u043f\u043e\u0432 \u0432 Java"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\u041f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043a\u043e\u0434\u0430 \u0438\u043d\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0438\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0442\u0438\u043f\u0430. \u042f\u0437\u044b\u043a\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u043e\u0434\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043f\u0430\u043c\u044f\u0442\u0438. <br \/>  <a name=\"habracut\"><\/a><br \/>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u044f\u0437\u044b\u043a\u0430\u0445 \u0421\/\u0421++ \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a.<\/p>\n<pre><code class=\"cpp\">  union value { \tint i; \tfloat f;   };      union value v;   v.i = 5; \/* v.f - undefined behaivor *\/ <\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0435\u0441\u043b\u0438 \u043c\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u043c\u0443 \u043f\u043e\u043b\u044e, \u0442\u043e \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u0431\u0443\u0434\u0435\u0442 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f. <\/p>\n<p>  \u0414\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 union \u0442\u0438\u043f\u0430\u043c\u044b \u0432 \u0421++17 \u0431\u044b\u043b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u043a\u043b\u0430\u0441\u0441 std::variant.<\/p>\n<pre><code class=\"cpp\">  std::variant&lt;int, float&gt; v { 5 };   std::cout &lt;&lt; \"int value: \" &lt;&lt; std::get&lt;int&gt;(v) &lt;&lt; std::endl; <\/code><\/pre>\n<p>  \u042f\u0437\u044b\u043a Java \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 union \u0442\u0438\u043f\u044b. \u041a\u0430\u043a \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0443, \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u0442\u0430-\u043a\u043b\u0430\u0441\u0441 \u0441 \u0434\u0432\u0443\u043c\u044f \u043f\u043e\u043b\u044f\u043c\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0441 \u0441\u0435\u0442\u0442\u0435\u0440\u0430\u043c\u0438 \u0438 \u0433\u0435\u0442\u0442\u0435\u0440\u0430\u043c\u0438. \u041d\u043e \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0447\u0442\u043e\u0431\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u043b\u043e\u0441\u044c \u0432 \u043e\u0434\u043d\u043e\u043c \u043f\u043e\u043b\u0435, \u0430 \u043d\u0435 \u0432 \u0434\u0432\u0443\u0445. <\/p>\n<p>  \u041a\u0430\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e \u0442\u0438\u043f\u0443 Object \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430, \u0430 \u043f\u043e\u0442\u043e\u043c \u043f\u0435\u0440\u0435\u043f\u0440\u0438\u0441\u0432\u043e\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0442\u0438\u043f\u0430. \u0418 \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u0430, \u043d\u0430\u043f\u043e\u0434\u043e\u0431\u0438\u0435 \u043a \u043a\u043b\u0430\u0441\u0441\u0443 std::variant.<\/p>\n<p>  \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432 \u044f\u0437\u044b\u043a\u0435 Java \u043d\u0435\u043b\u044c\u0437\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0442\u0438\u043f\u043e\u0432 \u0432 \u0434\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u0435, \u0442\u043e \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0442\u0438\u043f\u043e\u0432 \u043d\u0443\u0436\u043d\u0430 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u0430(Union2, Union3 \u0438 \u0442\u0434.). \u041d\u0430\u043f\u0438\u0448\u0438\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 Union \u0438 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0435\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438.<\/p>\n<pre><code class=\"java\">  public abstract class Union { \tprivate Union() {}  \tpublic abstract &lt;T&gt; void set(T value); \tpublic abstract &lt;T&gt; T get(Class&lt;T&gt; clazz);  \tpublic abstract &lt;T&gt; boolean isActive(Class&lt;T&gt; clazz); \tpublic abstract &lt;T&gt; Class&lt;T&gt; getActive();    } <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043a\u043b\u0430\u0441\u0441\u0430 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0431\u0440\u0438\u0447\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b. \u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0442\u0438\u043f\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0430\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u0430. <\/p>\n<pre><code class=\"java\">  public static &lt;T1, T2&gt; Union2&lt;T1, T2&gt; of(Class&lt;T1&gt; firstClass, Class&lt;T2&gt; secondClass) {         return new Union2&lt;&gt;(firstClass, secondClass);   }    public static &lt;T1, T2, T3&gt; Union3&lt;T1, T2, T3&gt; of(Class&lt;T1&gt; firstClass, Class&lt;T2&gt; secondClass, Class&lt;T3&gt; thirdClass) {         return new Union3&lt;&gt;(firstClass, secondClass, thirdClass);    } <\/code><\/pre>\n<p>  \u041a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0430\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f union \u043a\u043b\u0430\u0441\u0441\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0442\u0438\u043f\u043e\u0432 \u0438 \u043e\u0434\u043d\u043e \u043f\u043e\u043b\u0435 Object. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u043b\u0438 \u043c\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0435 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u0442\u0438\u043f, \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043e\u0448\u0438\u0431\u043a\u0443.<\/p>\n<pre><code class=\"java\"> private static class Union2&lt;T1, T2&gt; extends Union {         private final Class&lt;T1&gt; firstClass;         private final Class&lt;T2&gt; secondClass;         private Object value;          private Union2(Class&lt;T1&gt; firstClass, Class&lt;T2&gt; secondClass) {             this.firstClass = firstClass;             this.secondClass = secondClass;         }          @Override         public &lt;T&gt; void set(T value) {             if (value.getClass() == firstClass || value.getClass() == secondClass) {                 this.value = value;             } else {                 throw new UnionException(\"Incorrect type: \" + value.getClass().getName() +                           \"\\n\" + \"Union two types: [\" + firstClass.getName()  + \", \" +                           secondClass.getName() +  \"]\");             }         }          @Override         public &lt;T&gt; T get(Class&lt;T&gt; clazz) {             if (clazz == firstClass || clazz == secondClass) {                 return (T) value;             } else {                 throw new UnionException(\"Incorrect type: \" + value.getClass().getName() +                           \"\\n\" + \"Union two types: [\" + firstClass.getName()  + \", \" +                           secondClass.getName() +  \"]\");             }         }          @Override         public &lt;T&gt; boolean isActive(Class&lt;T&gt; clazz) {             return value.getClass() == clazz;         }          @Override         public &lt;T&gt; Class&lt;T&gt; getActive() {             return (Class&lt;T&gt;) value.getClass();         }     }   private static class Union3&lt;T1, T2, T3&gt; extends Union {         private final Class&lt;T1&gt; firstClass;         private final Class&lt;T2&gt; secondClass;         private final Class&lt;T3&gt; thirdClass;         private Object value;          private Union3(Class&lt;T1&gt; firstClass, Class&lt;T2&gt; secondClass, Class&lt;T3&gt; thirdClass) {             this.firstClass = firstClass;             this.secondClass = secondClass;             this.thirdClass = thirdClass;         }          @Override         public &lt;T&gt; void set(T value) {             if (value.getClass() == firstClass || value.getClass() == secondClass ||                  value.getClass() == thirdClass) {                 this.value = value;             } else {                 throw new UnionException(\"Incorrect type: \" + value.getClass().getName() +                           \"\\n\" + \"Union three types: [\" + firstClass.getName()  + \", \" +                           secondClass.getName() +  \", \"  + thirdClass.getName()  + \"]\");             }         }          @Override         public &lt;T&gt; T get(Class&lt;T&gt; clazz) {             if (clazz == firstClass || clazz == secondClass ||                 value.getClass() == thirdClass) {                 return (T) value;             } else {                 throw new UnionException(\"Incorrect type: \" + value.getClass().getName() +                           \"\\n\" + \"Union three types: [\" + firstClass.getName()  + \", \" +                           secondClass.getName() +  \", \"  + thirdClass.getName()  + \"]\");             }         }          @Override         public &lt;T&gt; boolean isActive(Class&lt;T&gt; clazz) {             return value.getClass() == clazz;         }          @Override         public &lt;T&gt; Class&lt;T&gt; getActive() {             return (Class&lt;T&gt;) value.getClass();         }     } <\/code><\/pre>\n<p>  \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441. \u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c\u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 Union, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043a\u043e\u0434 \u043f\u0440\u043e\u0449\u0435. <\/p>\n<pre><code class=\"java\">    Union triUnion = Union.of(Integer.class, String.class, Float.class);     triUnion.set(15f);      assertEquals(triUnion.getActive(), Float.class);     assertTrue(triUnion.isActive(Float.class));      triUnion.set(\"Dot\");      assertEquals(triUnion.getActive(), String.class);     assertTrue(triUnion.isActive(String.class));      triUnion.set(10);      assertEquals(triUnion.getActive(), Integer.class);     assertTrue(triUnion.isActive(Integer.class)); <\/code><\/pre>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432\u0438\u0437\u0438\u0442\u0435\u0440.<\/p>\n<pre><code class=\"java\">    Union biUnion = Union.of(Integer.class, String.class);     biUnion.set(\"Line\");     Union triUnion = Union.of(Integer.class, String.class, Float.class);     triUnion.set(15f);      matches(biUnion, \tInteger.class, i -&gt; System.out.println(\"bi-union number: \" + i), \tString.class,  s -&gt; System.out.println(\"bi-union string: \" + s)     ); \t     matches(triUnion, \tInteger.class, i -&gt; System.out.println(\"tri-union int:    \" + i), \tString.class,  s -&gt; System.out.println(\"tri-union string: \" + s), \tFloat.class,   f -&gt; System.out.println(\"tri-union float:  \" + f)     ); <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"java\">  public static &lt;V, T1, T2&gt; void matches(V value,                 Class&lt;T1&gt; firstClazz,  Consumer&lt;T1&gt; firstConsumer,                 Class&lt;T2&gt; secondClazz, Consumer&lt;T2&gt; secondConsumer) {         Class&lt;?&gt; valueClass = value.getClass();          if (firstClazz == valueClass) {             firstConsumer.accept((T1) value);         } else if (secondClazz == valueClass) {             secondConsumer.accept((T2) value);         }     } \t  public static &lt;T1, T2, T3&gt; void matches(Union value,                 Class&lt;T1&gt; firstClazz,  Purchaser&lt;T1&gt; firstConsumer,                 Class&lt;T2&gt; secondClazz, Purchaser&lt;T2&gt; secondConsumer,                 Class&lt;T3&gt; thirdClazz,  Purchaser&lt;T3&gt; thirdConsumer) {         Class&lt;?&gt; valueClass = value.getActive();          if (firstClazz == valueClass) {             firstConsumer.obtain(value.get(firstClazz));         } else if (secondClazz == valueClass) {             secondConsumer.obtain(value.get(secondClazz));         } else if (thirdClazz == valueClass) {             thirdConsumer.obtain(value.get(thirdClazz));         }     } <\/code><\/pre>\n<p>  \u041f\u043e\u0434\u0432\u043e\u0434\u044f \u0438\u0442\u043e\u0433\u0438, \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0447\u0442\u043e \u0432 \u044f\u0437\u044b\u043a\u0435 Java \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 union \u0442\u0438\u043f\u043e\u0432. \u041d\u043e \u043a\u0430\u043a \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a, \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0442\u0438\u043f\u043e\u0432 \u043d\u0443\u0436\u043d\u0430 \u0441\u0432\u043e\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0430\u0446\u0438\u044f union \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0432\u0441\u0435 \u0442\u0438\u043f\u044b.<\/p>\n<p>  \u041f\u043e\u043b\u043d\u044b\u0439 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u0434 \u043a\u043b\u0430\u0441\u0441\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 github: <a href=\"https:\/\/github.com\/klappdev\/jpml\/blob\/master\/src\/org\/kl\/util\/Union.java\">code<\/a><\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/465097\/\"> https:\/\/habr.com\/ru\/post\/465097\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\u041f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043a\u043e\u0434\u0430 \u0438\u043d\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0438\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0442\u0438\u043f\u0430. \u042f\u0437\u044b\u043a\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u043e\u0434\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043f\u0430\u043c\u044f\u0442\u0438.   <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-293895","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/293895","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=293895"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/293895\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=293895"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=293895"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=293895"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}