本文整理汇总了Java中org.openyu.commons.enumz.EnumHelper类的典型用法代码示例。如果您正苦于以下问题:Java EnumHelper类的具体用法?Java EnumHelper怎么用?Java EnumHelper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EnumHelper类属于org.openyu.commons.enumz包,在下文中一共展示了EnumHelper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getInstance
import org.openyu.commons.enumz.EnumHelper; //导入依赖的package包/类
/**
* 單例啟動
*
* @return
*/
public synchronized static BeanCollector getInstance(boolean start) {
if (instance == null) {
instance = CollectorHelper.readFromSer(BeanCollector.class);
// 此時有可能會沒有ser檔案,或舊的結構造成ex,只要再轉出一次ser,覆蓋原本ser即可
if (instance == null) {
instance = new BeanCollector();
}
//
if (start) {
// 啟動
instance.start();
}
// 此有系統預設值,只是為了轉出xml,並非給企劃編輯用
instance.trueFalseTypes = EnumHelper.valuesSet(TrueFalseType.class);
instance.whetherTypes = EnumHelper.valuesSet(WhetherType.class);
instance.orderTypes = EnumHelper.valuesSet(OrderType.class);
}
return instance;
}
示例2: sumOf
import org.openyu.commons.enumz.EnumHelper; //导入依赖的package包/类
@Test
@BenchmarkOptions(benchmarkRounds = 100, warmupRounds = 0, concurrency = 100)
public void sumOf() {
List<AttributeType> list = new LinkedList<AttributeType>();
list.add(AttributeType.HEALTH);
list.add(AttributeType.MAX_HEALTH);
list.add(AttributeType.MANA);
list.add(AttributeType.MAX_MANA);
//
double result = 0;
result = EnumHelper.sumOf(list);
System.out.println(result);
assertEquals(0, Double.compare(50, result));
AttributeType attributeType = AttributeType.MANA;
IntEnum intEnum = (IntEnum) attributeType;
System.out.println(intEnum instanceof IntEnum);
}
示例3: getInstance
import org.openyu.commons.enumz.EnumHelper; //导入依赖的package包/类
public synchronized static WuxingCollector getInstance(boolean start) {
if (instance == null) {
instance = CollectorHelper.readFromSer(WuxingCollector.class);
// 此時有可能會沒有ser檔案,或舊的結構造成ex,只要再轉出一次ser,覆蓋原本ser即可
if (instance == null) {
instance = new WuxingCollector();
}
//
if (start) {
// 啟動
instance.start();
}
// 此有系統值,只是為了轉出xml,並非給企劃編輯用
instance.wuxingTypes = EnumHelper.valuesSet(WuxingType.class);
}
return instance;
}
示例4: getInstance
import org.openyu.commons.enumz.EnumHelper; //导入依赖的package包/类
public synchronized static ManorCollector getInstance(boolean start) {
if (instance == null) {
instance = CollectorHelper.readFromSer(ManorCollector.class);
// 此時有可能會沒有ser檔案,或舊的結構造成ex,只要再轉出一次ser,覆蓋原本ser即可
if (instance == null) {
instance = new ManorCollector();
}
//
if (start) {
// 啟動
instance.start();
}
// 此有系統值,只是為了轉出xml,並非給企劃編輯用
instance.enhanceLevels = EnumHelper.valuesSet(EnhanceLevel.class);
//
}
return instance;
}
示例5: getInstance
import org.openyu.commons.enumz.EnumHelper; //导入依赖的package包/类
public synchronized static MaterialCollector getInstance(boolean start) {
if (instance == null) {
instance = CollectorHelper.readFromSer(MaterialCollector.class);
// 此時有可能會沒有ser檔案,或舊的結構造成ex,只要再轉出一次ser,覆蓋原本ser即可
if (instance == null) {
instance = new MaterialCollector();
}
//
if (start) {
// 啟動
instance.start();
}
// 此有系統值,只是為了轉出xml,並非給企劃編輯用
instance.materialTypes = EnumHelper.valuesSet(MaterialType.class);
}
return instance;
}
示例6: getInstance
import org.openyu.commons.enumz.EnumHelper; //导入依赖的package包/类
public synchronized static WeaponCollector getInstance(boolean start) {
if (instance == null) {
instance = CollectorHelper.readFromSer(WeaponCollector.class);
// 此時有可能會沒有ser檔案,或舊的結構造成ex,只要再轉出一次ser,覆蓋原本ser即可
if (instance == null) {
instance = new WeaponCollector();
}
//
if (start) {
// 啟動
instance.start();
}
// 此有系統值,只是為了轉出xml,並非給企劃編輯用
instance.levelTypes = EnumHelper.valuesSet(LevelType.class);
instance.positionTypes = EnumHelper.valuesSet(PositionType.class);
instance.seriesTypes = EnumHelper.valuesSet(SeriesType.class);
instance.enhanceLevels = EnumHelper.valuesSet(EnhanceLevel.class);
instance.weaponTypes = EnumHelper.valuesSet(WeaponType.class);
}
return instance;
}
示例7: getInstance
import org.openyu.commons.enumz.EnumHelper; //导入依赖的package包/类
public synchronized static ThingCollector getInstance(boolean start) {
if (instance == null) {
instance = CollectorHelper.readFromSer(ThingCollector.class);
// 此時有可能會沒有ser檔案,或舊的結構造成ex,只要再轉出一次ser,覆蓋原本ser即可
if (instance == null) {
instance = new ThingCollector();
}
//
if (start) {
// 啟動
instance.start();
}
// 此有系統值,只是為了轉出xml,並非給企劃編輯用
instance.thingTypes = EnumHelper.valuesSet(ThingType.class);
}
return instance;
}
示例8: getInstance
import org.openyu.commons.enumz.EnumHelper; //导入依赖的package包/类
public synchronized static ArmorCollector getInstance(boolean start) {
if (instance == null) {
instance = CollectorHelper.readFromSer(ArmorCollector.class);
// 此時有可能會沒有ser檔案,或舊的結構造成ex,只要再轉出一次ser,覆蓋原本ser即可
if (instance == null) {
instance = new ArmorCollector();
}
//
if (start) {
// 啟動
instance.start();
}
// 此有系統值,只是為了轉出xml,並非給企劃編輯用
instance.levelTypes = EnumHelper.valuesSet(LevelType.class);
instance.positionTypes = EnumHelper.valuesSet(PositionType.class);
instance.seriesTypes = EnumHelper.valuesSet(SeriesType.class);
instance.enhanceLevels = EnumHelper.valuesSet(EnhanceLevel.class);
}
return instance;
}
示例9: getInstance
import org.openyu.commons.enumz.EnumHelper; //导入依赖的package包/类
public synchronized static MailCollector getInstance(boolean start) {
if (instance == null) {
instance = CollectorHelper.readFromSer(MailCollector.class);
// 此時有可能會沒有ser檔案,或舊的結構造成ex,只要再轉出一次ser,覆蓋原本ser即可
if (instance == null) {
instance = new MailCollector();
}
//
if (start) {
// 啟動
instance.start();
}
// 此有系統值,只是為了轉出xml,並非給企劃編輯用
instance.mailTypes = EnumHelper.valuesSet(MailType.class);
}
return instance;
}
示例10: getInstance
import org.openyu.commons.enumz.EnumHelper; //导入依赖的package包/类
public synchronized static QixingCollector getInstance(boolean start) {
if (instance == null) {
instance = CollectorHelper.readFromSer(QixingCollector.class);
// 此時有可能會沒有ser檔案,或舊的結構造成ex,只要再轉出一次ser,覆蓋原本ser即可
if (instance == null) {
instance = new QixingCollector();
}
//
if (start) {
// 啟動
instance.start();
}
// 此有系統值,只是為了轉出xml,並非給企劃編輯用
instance.qixingTypes = EnumHelper.valuesSet(QixingType.class);
}
return instance;
}
示例11: getInstance
import org.openyu.commons.enumz.EnumHelper; //导入依赖的package包/类
public synchronized static SasangCollector getInstance(boolean start) {
if (instance == null) {
instance = CollectorHelper.readFromSer(SasangCollector.class);
// 此時有可能會沒有ser檔案,或舊的結構造成ex,只要再轉出一次ser,覆蓋原本ser即可
if (instance == null) {
instance = new SasangCollector();
}
//
if (start) {
// 啟動
instance.start();
}
// 此有系統值,只是為了轉出xml,並非給企劃編輯用
instance.sasangTypes = EnumHelper.valuesSet(SasangType.class);
}
return instance;
}
示例12: unmarshal
import org.openyu.commons.enumz.EnumHelper; //导入依赖的package包/类
/**
* 反欄位組成物件
*/
@SuppressWarnings("unchecked")
public <R, T, O> R unmarshal(T value, O owner, SessionImplementor session) {
RaceType 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;
}
示例13: 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;
}
示例14: unmarshal
import org.openyu.commons.enumz.EnumHelper; //导入依赖的package包/类
/**
* 反欄位組成物件
*/
@SuppressWarnings("unchecked")
public <R, T, O> R unmarshal(T value, O owner, SessionImplementor session) {
Industry 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;
}
示例15: getInstance
import org.openyu.commons.enumz.EnumHelper; //导入依赖的package包/类
public synchronized static CareerCollector getInstance(boolean start) {
if (instance == null) {
instance = CollectorHelper.readFromSer(CareerCollector.class);
// 此時有可能會沒有ser檔案,或舊的結構造成ex,只要再轉出一次ser,覆蓋原本ser即可
if (instance == null) {
instance = new CareerCollector();
}
//
if (start) {
// 啟動
instance.start();
}
instance.careerTypes = EnumHelper.valuesSet(CareerType.class);
instance.attributeTypes = EnumHelper.valuesSet(AttributeType.class);
}
return instance;
}