There is no fixed rule for judging whether its best to put the logic in the getter
or the setter
(or neither). You'll have to decide depending on your application.
In general I'd recommend doing it in the getter
as the gender might never get requested, in which case you'd have wasted an insignificant amount of processing power and ram if you did it in the setter.
Also the logic might be attached to other fields that may not have the same value at the time you set the gender as opposed to when you request it.