Revert "removed method setType()"

This reverts commit d5ab666a2ceddb5a3cb54b52328b5cac5808e922.