The term public officer means any officer of the legislative, executive and judicial departments of the state whether elected or appointed, including officers of the boards, commissions, bureaus and all other agencies of this state and the departments thereof, and including officers of the state legislature and the officers and clerks of the courts of this state and, in like manner, the county and municipal officers of the counties, cities, towns and villages of this state.