本文整理汇总了Java中org.openyu.commons.enumz.EnumHelper.valueOf方法的典型用法代码示例。如果您正苦于以下问题:Java EnumHelper.valueOf方法的具体用法?Java EnumHelper.valueOf怎么用?Java EnumHelper.valueOf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openyu.commons.enumz.EnumHelper
的用法示例。
在下文中一共展示了EnumHelper.valueOf方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: unmarshal
import org.openyu.commons.enumz.EnumHelper; //导入方法依赖的package包/类
/**
* 反欄位組成物件
*/
public <R, T, O> R unmarshal(T value, O owner, SessionImplementor session) {
CareerType result = null;
//
if (value instanceof String) {
StringBuilder src = new StringBuilder((String) value);
int vol = disassembleVol(src);
VolType volType = EnumHelper.valueOf(VolType.class, vol);
//
if (volType == null) {
return (R) result;
}
// v1
if (volType.getValue() >= 1) {
result = disassembleBy_1(src);
}
// v2,有新增的欄位,則繼續塞
if (volType.getValue() >= 2) {
}
}
return (R) result;
}
示例2: unmarshal
import org.openyu.commons.enumz.EnumHelper; //导入方法依赖的package包/类
/**
* 反欄位組成物件
*/
@SuppressWarnings("unchecked")
public <R, T, O> R unmarshal(T value, O owner, SessionImplementor session) {
Map<String, String> result = new LinkedHashMap<String, String>();
//
if (!(value instanceof String)) {
return (R) result;
}
//
StringBuilder src = new StringBuilder((String) value);
int vol = disassembleVol(src);
VolType volType = EnumHelper.valueOf(VolType.class, vol);
//
if (volType == null) {
return (R) result;
}
// v1
if (volType.getValue() >= 1) {
result = disassembleBy_1(src);
}
// v2,有新增的欄位,則繼續塞
if (volType.getValue() >= 2) {
}
return (R) result;
}
示例3: unmarshal
import org.openyu.commons.enumz.EnumHelper; //导入方法依赖的package包/类
/**
* 由欄位反組成物件
*/
@SuppressWarnings("unchecked")
public <R, T, O> R unmarshal(T value, O owner, SessionImplementor session) {
// 預設傳回空物件,非null
Set<LocaleNameBean> result = new LinkedHashSet<LocaleNameBean>();
//
if (!(value instanceof String)) {
return (R) result;
}
//
StringBuilder src = new StringBuilder((String) value);
int vol = disassembleVol(src);
VolType volType = EnumHelper.valueOf(VolType.class, vol);
//
if (volType == null) {
return (R) result;
}
// v1
if (volType.getValue() >= 1) {
result = disassembleBy_1(src);
}
// v2,有新增的欄位,則繼續塞
if (volType.getValue() >= 2) {
}
return (R) result;
}
示例4: unmarshal
import org.openyu.commons.enumz.EnumHelper; //导入方法依赖的package包/类
/**
* 反欄位組成物件
*/
@SuppressWarnings("unchecked")
public <R, T, O> R unmarshal(T value, O owner, SessionImplementor session) {
Map<String, Integer> result = new LinkedHashMap<String, Integer>();
//
if (!(value instanceof String)) {
return (R) result;
}
//
StringBuilder src = new StringBuilder((String) value);
int vol = disassembleVol(src);
VolType volType = EnumHelper.valueOf(VolType.class, vol);
//
if (volType == null) {
return (R) result;
}
// v1
if (volType.getValue() >= 1) {
result = disassembleBy_1(src);
}
// v2,有新增的欄位,則繼續塞
if (volType.getValue() >= 2) {
}
return (R) result;
}
示例5: unmarshal
import org.openyu.commons.enumz.EnumHelper; //导入方法依赖的package包/类
/**
* 反欄位組成物件
*/
@SuppressWarnings("unchecked")
public <R, T, O> R unmarshal(T value, O owner, SessionImplementor session) {
Map<Integer, String> result = new LinkedHashMap<Integer, String>();
//
if (!(value instanceof String)) {
return (R) result;
}
//
StringBuilder src = new StringBuilder((String) value);
int vol = disassembleVol(src);
VolType volType = EnumHelper.valueOf(VolType.class, vol);
//
if (volType == null) {
return (R) result;
}
// v1
if (volType.getValue() >= 1) {
result = disassembleBy_1(src);
}
// v2,有新增的欄位,則繼續塞
if (volType.getValue() >= 2) {
}
return (R) result;
}
示例6: unmarshal
import org.openyu.commons.enumz.EnumHelper; //导入方法依赖的package包/类
/**
* 反欄位組成物件
*/
@SuppressWarnings("unchecked")
public <R, T, O> R unmarshal(T value, O owner, SessionImplementor session) {
Set<Integer> result = new LinkedHashSet<Integer>();
//
if (!(value instanceof String)) {
return (R) result;
}
//
StringBuilder src = new StringBuilder((String) value);
int vol = disassembleVol(src);
VolType volType = EnumHelper.valueOf(VolType.class, vol);
//
if (volType == null) {
return (R) result;
}
// v1
if (volType.getValue() >= 1) {
result = disassembleBy_1(src);
}
// v2,有新增的欄位,則繼續塞
if (volType.getValue() >= 2) {
}
return (R) result;
}
示例7: unmarshal
import org.openyu.commons.enumz.EnumHelper; //导入方法依赖的package包/类
/**
* 由欄位反組成物件
*/
@SuppressWarnings("unchecked")
public <R, T, O> R unmarshal(T value, O owner, SessionImplementor session) {
// 預設傳回空物件,非null
AuditEntity result = new AuditEntitySupporter();
//
if (!(value instanceof String)) {
return (R) result;
}
//
StringBuilder src = new StringBuilder((String) value);
int vol = disassembleVol(src);
VolType volType = EnumHelper.valueOf(VolType.class, vol);
//
if (volType == null) {
return (R) result;
}
// v1
if (volType.getValue() >= 1) {
result = disassembleBy_1(src);
}
// v2,有新增的欄位,則繼續塞
if (volType.getValue() >= 2) {
}
return (R) result;
}
示例8: valueOf
import org.openyu.commons.enumz.EnumHelper; //导入方法依赖的package包/类
@Test
@BenchmarkOptions(benchmarkRounds = 100, warmupRounds = 0, concurrency = 100)
public void valueOf() {
RaceType result = null;
result = EnumHelper.valueOf(RaceType.class, 1);
System.out.println(result + ", " + result.getValue());
assertEquals(RaceType.YUAN, result);
//
result = RaceType.valueOf("HUMAN");
System.out.println(result + ", " + result.getValue());
assertEquals(RaceType.YUAN, result);
}
示例9: disassembleBy_1
import org.openyu.commons.enumz.EnumHelper; //导入方法依赖的package包/类
public ActionType disassembleBy_1(StringBuilder src) {
ActionType result = null;
if (src == null) {
return result;
}
//
result = EnumHelper.valueOf(ActionType.class,
toObject(src.toString(), int.class));
return result;
}
示例10: disassembleBy_1
import org.openyu.commons.enumz.EnumHelper; //导入方法依赖的package包/类
/**
* v1 由欄位反組成物件
*
* @param src
* @return
*/
public ChannelType disassembleBy_1(StringBuilder src) {
ChannelType result = null;
if (src == null) {
return result;
}
//
result = EnumHelper.valueOf(ChannelType.class,
toObject(src.toString(), int.class));
return result;
}
示例11: unmarshal
import org.openyu.commons.enumz.EnumHelper; //导入方法依赖的package包/类
/**
* 反欄位組成物件
*/
@SuppressWarnings("unchecked")
public <R, T, O> R unmarshal(T value, O owner, SessionImplementor session) {
PutType result = null;
//
//
if (!(value instanceof String)) {
return (R) result;
}
//
StringBuilder src = new StringBuilder((String) value);
int vol = disassembleVol(src);
VolType volType = EnumHelper.valueOf(VolType.class, vol);
//
if (volType == null) {
return (R) result;
}
// v1
if (volType.getValue() >= 1) {
result = disassembleBy_1(src);
}
// v2,有新增的欄位,則繼續塞
if (volType.getValue() >= 2) {
}
return (R) result;
}
示例12: unmarshal
import org.openyu.commons.enumz.EnumHelper; //导入方法依赖的package包/类
/**
* 由欄位反組成物件
*/
@SuppressWarnings("unchecked")
public <R, T, O> R unmarshal(T value, O owner, SessionImplementor session) {
// 預設傳回空物件,非null
FriendGroup result = new FriendGroupImpl();
//
if (!(value instanceof String)) {
return (R) result;
}
//
StringBuilder src = new StringBuilder((String) value);
int vol = disassembleVol(src);
VolType volType = EnumHelper.valueOf(VolType.class, vol);
//
if (volType == null) {
return (R) result;
}
// v1
if (volType.getValue() >= 1) {
result = disassembleBy_1(src);
}
// v2,有新增的欄位,則繼續塞
if (volType.getValue() >= 2) {
}
return (R) result;
}
示例13: unmarshal
import org.openyu.commons.enumz.EnumHelper; //导入方法依赖的package包/类
/**
* 由欄位反組成物件
*/
@SuppressWarnings("unchecked")
public <R, T, O> R unmarshal(T value, O owner, SessionImplementor session) {
WuxingInfo result = new WuxingInfoImpl();
//
if (!(value instanceof String)) {
return (R) result;
}
//
StringBuilder src = new StringBuilder((String) value);
int vol = disassembleVol(src);
VolType volType = EnumHelper.valueOf(VolType.class, vol);
//
if (volType == null) {
return (R) result;
}
// v1
if (volType.getValue() >= 1) {
result = disassembleBy_1(src);
}
// v2,有新增的欄位,則繼續塞
if (volType.getValue() >= 2) {
}
return (R) result;
}
示例14: play
import org.openyu.commons.enumz.EnumHelper; //导入方法依赖的package包/类
/**
* 玩五行
*
* @param sendable
* @param role
* @param playValue
* 玩的類別 @see PlayType
* @return
*/
public PlayResult play(boolean sendable, Role role, int playValue) {
PlayResult result = null;
// 玩的類別
PlayType playType = EnumHelper.valueOf(PlayType.class, playValue);
if (playType == null) {
return result;
}
//
switch (playType) {
case BRONZE: {
// 用金幣玩
result = goldPlay(sendable, role);
break;
}
// 用道具或儲值幣玩
case GALACTIC:
case GOLDEN:
case BLACK: {
result = itemCoinPlay(sendable, role, playType);
break;
}
default: {
if (sendable) {
// 玩的類別不存在
sendPlay(ErrorType.PLAY_TYPE_NOT_EXIST, role, result);
}
break;
}
}
//
return result;
}
示例15: unmarshal
import org.openyu.commons.enumz.EnumHelper; //导入方法依赖的package包/类
/**
* 反欄位組成物件
*/
@SuppressWarnings("unchecked")
public <R, T, O> R unmarshal(T value, O owner, SessionImplementor session) {
ActionType result = null;
//
if (!(value instanceof String)) {
return (R) result;
}
//
StringBuilder src = new StringBuilder((String) value);
int vol = disassembleVol(src);
VolType volType = EnumHelper.valueOf(VolType.class, vol);
//
if (volType == null) {
return (R) result;
}
// v1
if (volType.getValue() >= 1) {
result = disassembleBy_1(src);
}
// v2,有新增的欄位,則繼續塞
if (volType.getValue() >= 2) {
}
return (R) result;
}