setReadOnly method