title: Save complicated object without serialization
body: <p>I would like to save this kind of object </p>
  
  <pre><code>public interface Politic&lt;S, A&gt; extends Serializable {
  
       public A computeAction(S state, A... autorizedActions);
  }
  </code></pre>
  
  <p>At first, I used serializable for convenience, probleme is this inferface could depend on many other classes offtently modified, so I'm afraid I would not be able to deserialize.</p>
  
  <p>Also, I can't simply use Json format because this interface depend on many parameters I can't know in advance. A politic is the result of a machine learning algorithm, and it is often a very complicated function I can't describe easily.</p>
  
  <p>A typical politic would be like this</p>
  
  <pre><code>        Q&lt;S, A, Double&gt; q = (s, a) -&gt; constructQ(s, a);
          Politic&lt;S, A&gt; pi = (s, autorizedActions) -&gt; {
              return argmax(autorizedActions, s, q);
          };
  </code></pre>
  
  <p>where constructQ create a polynomial function (in this case it is quite simple, I just have to save coefficients of the polynomial function, but it could be something more complicated)</p>