Get type and set type validated with masks