本文整理汇总了Java中org.jboss.dmr.ModelType.equals方法的典型用法代码示例。如果您正苦于以下问题:Java ModelType.equals方法的具体用法?Java ModelType.equals怎么用?Java ModelType.equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.dmr.ModelType
的用法示例。
在下文中一共展示了ModelType.equals方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onSuccess
import org.jboss.dmr.ModelType; //导入方法依赖的package包/类
@Override
public void onSuccess(ModelNode outcome, ModelNode result) throws AdminProcessingException {
List<ModelNode> props = outcome.get("result").asList();
for (ModelNode prop:props) {
if (prop.getType().equals(ModelType.PROPERTY)) {
org.jboss.dmr.Property p = prop.asProperty();
ModelType type = p.getValue().getType();
if (p.getValue().isDefined() && !type.equals(ModelType.LIST) && !type.equals(ModelType.OBJECT)) {
if (p.getName().equals("driver-name")
|| p.getName().equals("jndi-name")
|| !excludeProperty(p.getName())) {
this.dsProperties.setProperty(p.getName(), p.getValue().asString());
}
}
}
}
}
示例2: addDmrValueTo
import org.jboss.dmr.ModelType; //导入方法依赖的package包/类
private void addDmrValueTo(ModelNode target, ModelType type, Object propValue)
{
if(type.equals(ModelType.STRING))
{
target.add((String) propValue);
}
else if(type.equals(ModelType.INT))
{
target.add((Integer) propValue);
}
else if(type.equals(ModelType.DOUBLE))
{
target.add((Double) propValue);
}
else if(type.equals(ModelType.LONG))
{
target.add((Long) propValue);
}
else if(type.equals(ModelType.BOOLEAN))
{
target.add((Boolean) propValue);
}
else if (type.equals(ModelType.OBJECT)) {
ModelNode val = target.addEmptyObject();
Map<String,?> map = (Map) propValue;
for (String key : map.keySet()) {
Object value = map.get(key);
if ( value instanceof String ) {
val.get( key ).set( (String) value );
} else if ( value instanceof Boolean ) {
val.get( key ).set( (Boolean) value );
}
}
}
else
{
throw new RuntimeException("Unsupported DMR type: "+type);
}
}
示例3: addJavaValueTo
import org.jboss.dmr.ModelType; //导入方法依赖的package包/类
private void addJavaValueTo(List target, ModelType type, ModelNode propValue)
{
if(type.equals(ModelType.STRING))
{
target.add(propValue.asString());
}
else if(type.equals(ModelType.INT))
{
target.add(propValue.asInt());
}
else if(type.equals(ModelType.DOUBLE))
{
target.add(propValue.asDouble());
}
else if(type.equals(ModelType.LONG))
{
target.add(propValue.asLong());
}
else if(type.equals(ModelType.BOOLEAN))
{
target.add(propValue.asBoolean());
}
else
{
throw new RuntimeException("Unsupported DMR type: "+type);
}
}
示例4: toJavaValue
import org.jboss.dmr.ModelType; //导入方法依赖的package包/类
private Object toJavaValue(ModelType type, ModelNode propValue) {
if (type.equals(ModelType.STRING)) {
return propValue.asString();
} else if (type.equals(ModelType.INT)) {
return propValue.asInt();
} else if (type.equals(ModelType.DOUBLE)) {
return propValue.asDouble();
} else if (type.equals(ModelType.LONG)) {
return propValue.asLong();
} else if (type.equals(ModelType.BOOLEAN)) {
return propValue.asBoolean();
} else {
throw new RuntimeException("Unsupported DMR type: " + type);
}
}
示例5: setDmrValueOn
import org.jboss.dmr.ModelType; //导入方法依赖的package包/类
private ModelNode setDmrValueOn(ModelNode target, ModelType type, Object propValue)
{
if(type.equals(ModelType.STRING))
{
String value = propValue.toString();
if (value.startsWith("${") && value.endsWith("}")) value = new ValueExpression(value).resolveString();
target.set(value);
}
else if(type.equals(ModelType.INT))
{
target.set((Integer) propValue);
}
else if(type.equals(ModelType.DOUBLE))
{
target.set((Double) propValue);
}
else if(type.equals(ModelType.LONG))
{
target.set((Long) propValue);
}
else if(type.equals(ModelType.BOOLEAN))
{
target.set((Boolean) propValue);
}
else if (type.equals(ModelType.BIG_DECIMAL ) ) {
target.set((BigDecimal) propValue);
}
else if(type.equals(ModelType.LIST))
{
target.setEmptyList();
List list = (List)propValue;
for(Object item : list)
target.add(String.valueOf(item));
}
else
{
throw new RuntimeException("Unsupported DMR type: "+type);
}
return target;
}