UserType
module Module4 { enum UserType {admin, user, guest}; };
package Module4; public final class UserType implements org.omg.CORBA.portable.IDLEntity { private int value = -1; public static final int _admin = 0; public static final UserType admin = new UserType(_admin); public static final int _user = 1; public static final UserType user = new UserType(_user); public static final int _guest = 2; public static final UserType guest = new UserType(_guest); public int value() { return value; } public static UserType from_int(int value) { switch (value) { case _admin: return admin; case _user: return user; case _guest: return guest; default: return null; } } public UserType(int i) { value = i; } }
package Module4; public final class UserType implements org.omg.CORBA.portable.IDLEntity { private int value = -1; public static final int _admin = 0; public final UserType admin = new UserType(_admin); public static final int _user = 1; public final UserType user = new UserType(_user); public static final int _guest = 2; public final UserType guest = new UserType(_guest); public int value() { return value; } public UserType from_int(int value) { switch (value) { case _admin: return admin; case _user: return user; case _guest: return guest; default: return null; } } private UserType(int i) { value = i; } }
package Module4; public final class UserType implements org.omg.CORBA.portable.IDLEntity { private int value = -1; public static final int _admin = 0; public static final UserType admin = new UserType(_admin); public static final int _user = 1; public static final UserType user = new UserType(_user); public static final int _guest = 2; public static final UserType guest = new UserType(_guest); public int value() { return value; } public static UserType from_int(int value) { switch (value) { case _admin: return admin; case _user: return user; case _guest: return guest; default: return null; } } private UserType(int i) { value = i; } }
==
return new UserType(UserType._guest);
return UserType.guest;
return UserType.guest.value()
java.lang.Object
equals()
hash()