本文整理匯總了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;
}