本文整理汇总了Java中com.redhat.lightblue.metadata.types.BigIntegerType类的典型用法代码示例。如果您正苦于以下问题:Java BigIntegerType类的具体用法?Java BigIntegerType怎么用?Java BigIntegerType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BigIntegerType类属于com.redhat.lightblue.metadata.types包,在下文中一共展示了BigIntegerType类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testTranslate_SimpleField_BigIntegerType
import com.redhat.lightblue.metadata.types.BigIntegerType; //导入依赖的package包/类
@Test
public void testTranslate_SimpleField_BigIntegerType() throws JSONException{
SearchResultEntry result = new SearchResultEntry(-1, "uid=john.doe,dc=example,dc=com", new Attribute[]{
new Attribute("key", BigInteger.ZERO.toString())
});
EntityMetadata md = fakeEntityMetadata("fakeMetadata",
new SimpleField("key", BigIntegerType.TYPE)
);
JsonDoc document = new ResultTranslatorToJson(factory, md, new TrivialLdapFieldNameTranslator()).translate(result);
assertNotNull(document);
JSONAssert.assertEquals(
"{\"key\":" + BigInteger.ZERO + ",\"dn\":\"uid=john.doe,dc=example,dc=com\"}",
document.toString(),
true);
}
示例2: isValidForFieldType
import com.redhat.lightblue.metadata.types.BigIntegerType; //导入依赖的package包/类
@Override
public boolean isValidForFieldType(Type fieldType) {
return IntegerType.TYPE.equals(fieldType)
|| DoubleType.TYPE.equals(fieldType)
|| BigDecimalType.TYPE.equals(fieldType)
|| BigIntegerType.TYPE.equals(fieldType);
}
示例3: getTypeForClass
import com.redhat.lightblue.metadata.types.BigIntegerType; //导入依赖的package包/类
private Type getTypeForClass(Class<?> type) {
if (type.equals(String.class) || type.isEnum()) {
return StringType.TYPE;
}
if (type.equals(boolean.class) || type.equals(Boolean.class)) {
return BooleanType.TYPE;
}
if (type.equals(Date.class) || Temporal.class.isAssignableFrom(type)) {
return DateType.TYPE;
}
if (type.equals(BigDecimal.class)) {
return BigDecimalType.TYPE;
}
if (type.equals(BigInteger.class)) {
return BigIntegerType.TYPE;
}
if (type.equals(byte[].class)) {
return BinaryType.TYPE;
}
if (type.equals(double.class) || type.equals(Double.class)) {
return DoubleType.TYPE;
}
if (type.equals(int.class) || type.equals(Integer.class)) {
return IntegerType.TYPE;
}
if (Iterable.class.isAssignableFrom(type)) {
return ArrayType.TYPE;
}
// TODO: Reference type, UUID type
return ObjectType.TYPE;
}