On the final judgment, the court may, if the applicant obtain relief, direct the jury trying the cause to assess damages, or may impanel a jury for that purpose, may order restitution of the property, or give such other judgment in the applicant's favor as the state of the case requires.