title: Why should we declare an interface inside a class?
body: <p>Why should we declare an interface inside a class in Java?</p>
  
  <p>For example:</p>
  
  <pre><code>public class GenericModelLinker implements IModelLinker {
  
    private static final Logger LOG =LoggerFactory.getLogger(GenericModelLinker.class);
    private String joinAsPropertyField;
    private boolean joinAsListEntry;
    private boolean clearList;
    private List&lt;Link&gt; joins;
  
    //instead of a scalar property
    private String uniqueProperty;
  
    public interface Link {
  
      Object getProperty(IAdaptable n);
  
      void setProperty(IAdaptable n, Object value);
  
    }
  }
  </code></pre>