当前位置: 首页>>代码示例>>Java>>正文


Java EnumHelper.valueOf方法代码示例

本文整理汇总了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;
}
 
开发者ID:mixaceh,项目名称:openyu-mix,代码行数:28,代码来源:CareerTypeUserType.java

示例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;
}
 
开发者ID:mixaceh,项目名称:openyu-commons,代码行数:30,代码来源:StringStringUserType.java

示例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;
}
 
开发者ID:mixaceh,项目名称:openyu-commons,代码行数:31,代码来源:NamesBeanUserType.java

示例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;
}
 
开发者ID:mixaceh,项目名称:openyu-commons,代码行数:30,代码来源:StringIntegerUserType.java

示例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;
}
 
开发者ID:mixaceh,项目名称:openyu-commons,代码行数:30,代码来源:IntegerStringUserType.java

示例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;
}
 
开发者ID:mixaceh,项目名称:openyu-commons,代码行数:30,代码来源:IntegerSetUserType.java

示例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;
}
 
开发者ID:mixaceh,项目名称:openyu-commons,代码行数:31,代码来源:AuditEntityUserType.java

示例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);
}
 
开发者ID:mixaceh,项目名称:openyu-mix,代码行数:14,代码来源:RaceTypeTest.java

示例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;
}
 
开发者ID:mixaceh,项目名称:openyu-mix,代码行数:11,代码来源:ActionTypeUserTypeBak.java

示例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;
}
 
开发者ID:mixaceh,项目名称:openyu-mix,代码行数:17,代码来源:ChannelTypeUserType.java

示例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;
}
 
开发者ID:mixaceh,项目名称:openyu-mix,代码行数:31,代码来源:PutTypeUserType.java

示例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;
}
 
开发者ID:mixaceh,项目名称:openyu-mix,代码行数:31,代码来源:FriendGroupUserType.java

示例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;
}
 
开发者ID:mixaceh,项目名称:openyu-mix,代码行数:30,代码来源:WuxingInfoUserType.java

示例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;
}
 
开发者ID:mixaceh,项目名称:openyu-mix,代码行数:42,代码来源:WuxingServiceImpl.java

示例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;
}
 
开发者ID:mixaceh,项目名称:openyu-mix,代码行数:30,代码来源:ActionTypeUserTypeBak.java


注:本文中的org.openyu.commons.enumz.EnumHelper.valueOf方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。