title: factory object and case class
body: <p>I want to create factory object with apply method defined that would create underlying case class - here is a sample code</p>
  
  <pre><code>object DeptEntry {  
    def apply(url: String, fullName: String, address: String, city: String): DeptEntry = {
      new DeptEntry(url.toLowerCase, fullName.toLowerCase, address.toLowerCase, city.toLowerCase)
    }
  }
  
  case class DeptEntry private(url: String, fullName: String, address: String, city: String) {
  }
  </code></pre>
  
  <p>The problem is that apply method in the object and case class's constructor have the same parameter list.
  So compiler gives me this error:</p>
  
  <pre><code>method apply is defined twice
    conflicting symbols both originated in file 'DeptEntry.scala'
  case class DeptEntry private(url: String, fullName: String,
         ^
  </code></pre>
  
  <p>Is there some workaround for this problem?</p>
  
  <p>Thanks a lot</p>