实体字段类型用的Byte,为什么不用int或Integer类型呢?

请问后端 的这种代码,里面的Type 为什么不用直接传的 int 或 Integer 类型呢?一定要Byte类型才好?

//控制层判断代码
if (new Byte(type) == 0) {
            Collect.setSongId(Integer.parseInt(songId));//放入歌曲id字段
        } else if (new Byte(type) == 1) {
            Collect.setSongListId(Integer.parseInt(songListId));//放入歌单id字段
        } else if (new Byte(type) == 2) {
            Collect.setAlbumId(Integer.parseInt(albumId));//放入专辑id字段
        }

//数据库字段
private Byte type;



byte 占用1字节
int 占用4字节
有些字段就只有几种状态,根本不需要用到4字节这么大。比如性别,就两种状态。