本文整理汇总了Java中io.advantageous.boon.core.Sets.set方法的典型用法代码示例。如果您正苦于以下问题:Java Sets.set方法的具体用法?Java Sets.set怎么用?Java Sets.set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.advantageous.boon.core.Sets
的用法示例。
在下文中一共展示了Sets.set方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setup
import io.advantageous.boon.core.Sets; //导入方法依赖的package包/类
@Before
public void setup() throws Exception {
mdcForHttpRequestInterceptor = new SetupMdcForHttpRequestInterceptor(Sets.set("foo"));
methodCallBuilder = MethodCallBuilder.methodCallBuilder();
httpRequest = HttpRequestBuilder.httpRequestBuilder().setUri("/foo").setRemoteAddress("localhost")
.setMethodGet()
.addHeader("foo", "bar").build();
}
示例2: returnSet
import io.advantageous.boon.core.Sets; //导入方法依赖的package包/类
@RequestMapping("/returnSet")
public Set<Employee> returnSet() {
return Sets.set(new Employee(1, "Rick"), new Employee(2, "Diana"));
}
示例3: fromMap
import io.advantageous.boon.core.Sets; //导入方法依赖的package包/类
/**
* fromMap converts a map into a java object.
* @param map map to create the object from.
* @param clazz the new instance type
* @param excludeProperties the properties to exclude
* @param <T> generic type capture
* @return the new object
*/
@SuppressWarnings( "unchecked" )
public static <T> T fromMap( Map<String, Object> map, Class<T> clazz, String... excludeProperties ) {
Set<String> ignoreProps = excludeProperties.length > 0 ? Sets.set(excludeProperties) : null;
return new MapperComplex(FieldAccessMode.FIELD_THEN_PROPERTY.create( false ), ignoreProps, null, true).fromMap(map, clazz);
}
示例4: testIntegrationWithServiceBundle
import io.advantageous.boon.core.Sets; //导入方法依赖的package包/类
@Test
public void testIntegrationWithServiceBundle() throws Exception {
mdcForHttpRequestInterceptor = new SetupMdcForHttpRequestInterceptor(Sets.set("foo"));
final CaptureRequestInterceptor captureRequestInterceptor = new CaptureRequestInterceptor();
captureRequestInterceptor.before(methodCallBuilder.setName("restMethod").setOriginatingRequest(httpRequest).build());
final ServiceBundle serviceBundle = ServiceBundleBuilder.serviceBundleBuilder()
.setBeforeMethodCallOnServiceQueue(BeforeMethodCallChain.beforeMethodCallChain(captureRequestInterceptor, mdcForHttpRequestInterceptor))
.setAfterMethodCallOnServiceQueue(AfterMethodCallChain.afterMethodCallChain(captureRequestInterceptor, mdcForHttpRequestInterceptor))
.setBeforeMethodSent(new ForwardCallMethodInterceptor(new RequestContext())).build().startServiceBundle();
serviceBundle.addServiceObject("my", new MyServiceImpl());
final MyService localProxy = serviceBundle.createLocalProxy(MyService.class, "my");
final AsyncFutureCallback<String> callback = AsyncFutureBuilder.asyncFutureBuilder().build(String.class);
localProxy.getRequestURI(callback);
localProxy.clientProxyFlush();
assertEquals("/foo", callback.get());
final AsyncFutureCallback<Map<String, String>> callbackMap = AsyncFutureBuilder.asyncFutureBuilder()
.buildMap(String.class, String.class);
localProxy.getMDC(callbackMap);
localProxy.clientProxyFlush();
validate(callbackMap.get());
captureRequestInterceptor.after(null, null);
serviceBundle.stop();
}