本文整理了Java中cz.metacentrum.perun.core.api.Attribute.setType()
方法的一些代码示例,展示了Attribute.setType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Attribute.setType()
方法的具体详情如下:
包路径:cz.metacentrum.perun.core.api.Attribute
类名称:Attribute
方法名:setType
暂无
代码示例来源:origin: CESNET/perun
private static Attribute createAttribute(Map<String, String> beanAttr) throws InternalErrorException {
if(beanAttr==null) return null;
Attribute attribute = new Attribute();
attribute.setId(Integer.valueOf(beanAttr.get("id")));
attribute.setFriendlyName(BeansUtils.eraseEscaping(beanAttr.get("friendlyName")));
attribute.setNamespace(BeansUtils.eraseEscaping(beanAttr.get("namespace")));
attribute.setType(BeansUtils.eraseEscaping(beanAttr.get("type")));
attribute.setValue(BeansUtils.stringToAttributeValue(BeansUtils.eraseEscaping(beanAttr.get("value")), attribute.getType()));
attribute.setUnique(Boolean.valueOf(beanAttr.get("unique")));
return attribute;
}
代码示例来源:origin: CESNET/perun
/**
* Converts attribute value to string (serialize object to string).
* This is a wrapper for passing value and type only for specific use.
* @see #attributeValueToString(Attribute)
*
* @param attributeValue value of the attribute
* @param type type of resulting attribute
* @return string representation of the value
*
* @throws InternalErrorException
*/
@SuppressWarnings("unchecked")
public static String attributeValueToString(Object attributeValue, String type) throws InternalErrorException {
Attribute a = new Attribute();
a.setType(type);
a.setValue(attributeValue);
return attributeValueToString(a);
}
内容来源于网络,如有侵权,请联系作者删除!