Creates getter and setter methods for struct field.