<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Clojure Q&amp;A - Recent questions tagged encapsulation</title>
<link>https://ask.clojure.org/index.php/tag/encapsulation</link>
<description></description>
<item>
<title>Is it possible to gen-class with a private final field?</title>
<link>https://ask.clojure.org/index.php/8195/is-it-possible-to-gen-class-with-a-private-final-field</link>
<description>&lt;p&gt;How to create a Java class with a private final field in Clojure?&lt;/p&gt;
&lt;p&gt;ClojureDocs for &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojuredocs.org/clojure.core/gen-class&quot;&gt;gen-class&lt;/a&gt; says that &lt;code&gt;state&lt;/code&gt; field will be public&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;:state name - if supplied, a public final instance field with the given name will be&lt;br&gt;
created. &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;So, in other words, do we have a way to create a class and instantiate a java object with the encapsulated state? &lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8195/is-it-possible-to-gen-class-with-a-private-final-field</guid>
<pubDate>Fri, 26 Jul 2019 01:07:51 +0000</pubDate>
</item>
</channel>
</rss>