Restrict size in interface for a custom base type, so that implementing custom type follows it
<p>I want to define set of custom data types, eg. CountryCode, RegionCode, CategoryCode, XYZTypeCode etc (Similar to ISO Standard CCTS Type Code). I want to restrict that all of the code values should have maximum size of 6.So I defined an interface eg. 
<br/></p>

<pre><code>public interface CodeInterface{
    public interface Value{
  public char[] value= new char[6];
  public char[] listID = new char[8];
  public String listName = null;
  } 
 public List&lt;Value&gt; getCodeValues(); 
}
   ...
    public class Country implements CodeInterface{ 
        public List&lt;CodeInterface.Value&gt; getCodeValues() { 
            List&lt;CodeInterface.Value&gt; codeValues = new ArrayList&lt;CodeInterface.Value&gt;();
            CodeInterface.Value singleCodeValue = null;
            //Logic to get data from postgres DB....
            //Assign the code value
            singleCodeValue.content = (char[])resultSet.getString("CODE").toCharArray();
        }
    }
</code></pre>

<p></p>

<p>But the assignment has syntax error that "Final CodeInterface.Value.Content" cannot be assigned.
Please suggest a better and extendible approach.</p>

<p>Thanks!</p>
