Amr bin Amir (may Allah have mercy on him) said: Umar bin Abd al-Aziz (may Allah have mercy on him) said: It is not proper for a person to be a judge without five qualities; if one of them is missing, that is one defect, and if two are missing, those are two defects. (The five qualities are:) he knows about those who came before him, he consults people of sound opinion, he keeps away from greed, he shows forbearance towards the litigant, and he bears patiently with wrongdoers.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب آداب القاضي / 20361