本文整理匯總了Java中org.apache.tinkerpop.shaded.kryo.Registration.getId方法的典型用法代碼示例。如果您正苦於以下問題:Java Registration.getId方法的具體用法?Java Registration.getId怎麽用?Java Registration.getId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.tinkerpop.shaded.kryo.Registration
的用法示例。
在下文中一共展示了Registration.getId方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getRegistration
import org.apache.tinkerpop.shaded.kryo.Registration; //導入方法依賴的package包/類
public Registration getRegistration(final Class clazz) {
if (Color.class.isAssignableFrom(clazz)) {
final Registration registration = super.getRegistration(TinkerGraph.class);
return new Registration(registration.getType(), colorToGraphSerializer, registration.getId());
} else {
return super.getRegistration(clazz);
}
}
示例2: register
import org.apache.tinkerpop.shaded.kryo.Registration; //導入方法依賴的package包/類
@Override
public Registration register(final Registration registration) {
if (null == registration) throw new IllegalArgumentException("Registration cannot be null.");
if (registration.getId() != NAME) idToRegistration.put(registration.getId(), registration);
classToRegistration.put(registration.getType(), registration);
if (registration.getType().isPrimitive())
classToRegistration.put(getWrapperClass(registration.getType()), registration);
return registration;
}
示例3: writeClass
import org.apache.tinkerpop.shaded.kryo.Registration; //導入方法依賴的package包/類
@Override
public Registration writeClass(final Output output, final Class type) {
if (null == type) {
output.writeVarInt(Kryo.NULL, true);
return null;
}
final Registration registration = kryo.getRegistration(type);
if (registration.getId() == NAME)
writeName(output, type);
else
output.writeVarInt(registration.getId() + 2, true);
return registration;
}