本文整理汇总了Java中com.google.inject.util.Providers.guicify方法的典型用法代码示例。如果您正苦于以下问题:Java Providers.guicify方法的具体用法?Java Providers.guicify怎么用?Java Providers.guicify使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.inject.util.Providers
的用法示例。
在下文中一共展示了Providers.guicify方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testGuicify330Provider
import com.google.inject.util.Providers; //导入方法依赖的package包/类
public void testGuicify330Provider() {
Provider<String> jsr330Provider = new Provider<String>() {
@Override
public String get() {
return "A";
}
@Override
public String toString() {
return "jsr330Provider";
}
};
com.google.inject.Provider<String> guicified = Providers
.guicify(jsr330Provider);
assertEquals("guicified(jsr330Provider)", guicified.toString());
assertEquals("A", guicified.get());
// when you guicify the Guice-friendly, it's a no-op
assertSame(guicified, Providers.guicify(guicified));
}
示例2: testGuicify330Provider
import com.google.inject.util.Providers; //导入方法依赖的package包/类
public void testGuicify330Provider() {
Provider<String> jsr330Provider =
new Provider<String>() {
@Override
public String get() {
return "A";
}
@Override
public String toString() {
return "jsr330Provider";
}
};
com.google.inject.Provider<String> guicified = Providers.guicify(jsr330Provider);
assertEquals("guicified(jsr330Provider)", guicified.toString());
assertEquals("A", guicified.get());
// when you guicify the Guice-friendly, it's a no-op
assertSame(guicified, Providers.guicify(guicified));
assertFalse(guicified instanceof HasDependencies);
}
示例3: testGuicify330Provider
import com.google.inject.util.Providers; //导入方法依赖的package包/类
public void testGuicify330Provider() {
Provider<String> jsr330Provider = new Provider<String>() {
public String get() {
return "A";
}
@Override public String toString() {
return "jsr330Provider";
}
};
com.google.inject.Provider<String> guicified = Providers.guicify(jsr330Provider);
assertEquals("guicified(jsr330Provider)", guicified.toString());
assertEquals("A", guicified.get());
// when you guicify the Guice-friendly, it's a no-op
assertSame(guicified, Providers.guicify(guicified));
assertFalse(guicified instanceof HasDependencies);
}
示例4: getProviderInstance
import com.google.inject.util.Providers; //导入方法依赖的package包/类
public Provider<? extends T> getProviderInstance() {
return Providers.guicify(providerInstance);
}