当前位置: 首页>>代码示例>>Java>>正文


Java ProductProperty.setColor方法代码示例

本文整理汇总了Java中org.jai.search.model.ProductProperty.setColor方法的典型用法代码示例。如果您正苦于以下问题:Java ProductProperty.setColor方法的具体用法?Java ProductProperty.setColor怎么用?Java ProductProperty.setColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jai.search.model.ProductProperty的用法示例。


在下文中一共展示了ProductProperty.setColor方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getProductProperties

import org.jai.search.model.ProductProperty; //导入方法依赖的package包/类
private static Set<ProductProperty> getProductProperties()
{
    final Set<ProductProperty> productProperties = new HashSet<ProductProperty>();
    final String[] sizes = new String[] { PRODUCTPROPERTY_SIZE_12_INCH, PRODUCTPROPERTY_SIZE_13_INCH, PRODUCTPROPERTY_SIZE_15_INCH,
            PRODUCTPROPERTY_SIZE_17_INCH, PRODUCTPROPERTY_SIZE_21_INCH };
    final String[] colors = new String[] { PRODUCTPROPERTY_COLOR_BLACK, PRODUCTPROPERTY_COLOR_GREY, PRODUCTPROPERTY_COLOR_YELLOW,
            PRODUCTPROPERTY_COLOR_PURPLE, PRODUCTPROPERTY_COLOR_BROWN };
    for (int i = 1; i <= 5; i++)
    {
        final ProductProperty productProperty = new ProductProperty();
        productProperty.setId(Long.valueOf(i));
        // if (i <= 5)
        // {
        productProperty.setSize(sizes[i - 1]);
        productProperty.setColor(colors[i - 1]);
        // }
        // else
        // {
        // productProperty.setSize(sizes[j++]);
        // productProperty.setColor(colors[9 - i]);
        // }
        productProperties.add(productProperty);
    }
    logger.debug(productProperties.toString());
    return productProperties;
}
 
开发者ID:jaibeermalik,项目名称:elasticsearch-akka,代码行数:27,代码来源:SampleDataGeneratorServiceImpl.java

示例2: getProductProperties

import org.jai.search.model.ProductProperty; //导入方法依赖的package包/类
private static Set<ProductProperty> getProductProperties() {
	final Set<ProductProperty> productProperties = new HashSet<ProductProperty>();
	final String[] sizes = new String[] { PRODUCTPROPERTY_SIZE_12_INCH,
			PRODUCTPROPERTY_SIZE_13_INCH, PRODUCTPROPERTY_SIZE_15_INCH,
			PRODUCTPROPERTY_SIZE_17_INCH, PRODUCTPROPERTY_SIZE_21_INCH };
	final String[] colors = new String[] { PRODUCTPROPERTY_COLOR_BLACK,
			PRODUCTPROPERTY_COLOR_GREY, PRODUCTPROPERTY_COLOR_YELLOW,
			PRODUCTPROPERTY_COLOR_PURPLE, PRODUCTPROPERTY_COLOR_BROWN };
	for (int i = 1; i <= 5; i++) {
		final ProductProperty productProperty = new ProductProperty();
		productProperty.setId(Long.valueOf(i));
		// if (i <= 5)
		// {
		productProperty.setSize(sizes[i - 1]);
		productProperty.setColor(colors[i - 1]);
		// }
		// else
		// {
		// productProperty.setSize(sizes[j++]);
		// productProperty.setColor(colors[9 - i]);
		// }
		productProperties.add(productProperty);
	}
	logger.debug(productProperties.toString());
	return productProperties;
}
 
开发者ID:jaibeermalik,项目名称:searchanalytics-bigdata,代码行数:27,代码来源:SampleDataGeneratorServiceImpl.java

示例3: getProductProperties

import org.jai.search.model.ProductProperty; //导入方法依赖的package包/类
private Set<ProductProperty> getProductProperties()
{
    Set<ProductProperty> productProperties = new HashSet<ProductProperty>();
    
    String[] sizes = new String[] {PRODUCTPROPERTY_SIZE_12_INCH,
            PRODUCTPROPERTY_SIZE_13_INCH,
            PRODUCTPROPERTY_SIZE_15_INCH,
            PRODUCTPROPERTY_SIZE_17_INCH,
            PRODUCTPROPERTY_SIZE_21_INCH
    };

    String[] colors = new String[] {PRODUCTPROPERTY_COLOR_BLACK,
            PRODUCTPROPERTY_COLOR_GREY,
            PRODUCTPROPERTY_COLOR_YELLOW,
            PRODUCTPROPERTY_COLOR_PURPLE,
            PRODUCTPROPERTY_COLOR_BROWN
                                    }; 
    for (int i = 0, j=0; i < 10; i++)
    {
        ProductProperty productProperty = new ProductProperty();
        productProperty.setId(Long.valueOf(i));
        if(i<5)
        {
            productProperty.setSize(sizes[i]);
            productProperty.setColor(colors[i]);
        }
        else
        {
            productProperty.setSize(sizes[j++]);
            productProperty.setColor(colors[9-i]);
        }
        productProperties.add(productProperty);
    }
    System.out.println(productProperties);
    return productProperties;
}
 
开发者ID:jaibeermalik,项目名称:elasticsearch-tutorial,代码行数:37,代码来源:SampleDataGeneratorImpl.java

示例4: testProductPropertyDataGeneration

import org.jai.search.model.ProductProperty; //导入方法依赖的package包/类
@Test
public void testProductPropertyDataGeneration()
{
    final Props props = Props.create(DataGeneratorWorkerActor.class, sampleDataGeneratorService);
    final TestActorRef<DataGeneratorWorkerActor> ref = TestActorRef.create(system, props);
    
    ElasticSearchIndexConfig config = ElasticSearchIndexConfig.COM_WEBSITE;
    IndexDocumentType documentType = IndexDocumentType.PRODUCT_PROPERTY;
    String indexName = "trialindexName";
    IndexDocumentTypeMessageVO indexDocumentTypeMessageVO = new IndexDocumentTypeMessageVO()
            .config(config).documentType(documentType).newIndexName(indexName);

    Set<ProductProperty> productPropertList = new HashSet<ProductProperty>();
    ProductProperty productProperty = new ProductProperty();
    //For now ids hard coded in generator for testing
    Long productPropertyId = 1l;
    productProperty.setId(productPropertyId);
    productProperty.setColor(SampleDataGeneratorService.PRODUCTPROPERTY_COLOR_BLACK);
    productProperty.setSize(SampleDataGeneratorService.PRODUCTPROPERTY_SIZE_13_INCH);
    productPropertList.add(productProperty);
    
    expect(sampleDataGeneratorService.generateProductPropertySampleData()).andReturn(productPropertList);
    replay(sampleDataGeneratorService);
    
    TestProbe testProbe = TestProbe.apply(system);
    ref.tell(indexDocumentTypeMessageVO, testProbe.ref());
    verify(sampleDataGeneratorService);
    
    testProbe.expectMsgClass(Integer.class);     
    TestActor.Message sizeMessage = testProbe.lastMessage();
    Integer resultMsgCount = (Integer) sizeMessage.msg();
    assertEquals(1, resultMsgCount.intValue());
    
    testProbe.expectMsgClass(IndexDocumentVO.class);     
    TestActor.Message message = testProbe.lastMessage();
    IndexDocumentVO resultMsg = (IndexDocumentVO) message.msg();
    assertEquals(productPropertyId, resultMsg.getDocumentId());
    assertEquals(config, resultMsg.getConfig());
    assertEquals(documentType, resultMsg.getDocumentType());
    assertEquals(indexName, resultMsg.getNewIndexName());
}
 
开发者ID:jaibeermalik,项目名称:elasticsearch-akka,代码行数:42,代码来源:DataGeneratorWorkerActorTest.java

示例5: testProductPropertyDataGeneration

import org.jai.search.model.ProductProperty; //导入方法依赖的package包/类
@Test
public void testProductPropertyDataGeneration() {
	final Props props = Props.create(DataGeneratorWorkerActor.class,
			sampleDataGeneratorService);
	final TestActorRef<DataGeneratorWorkerActor> ref = TestActorRef.create(
			system, props);

	ElasticSearchIndexConfig config = ElasticSearchIndexConfig.COM_WEBSITE;
	IndexDocumentType documentType = IndexDocumentType.PRODUCT_PROPERTY;
	String indexName = "trialindexName";
	IndexDocumentTypeMessageVO indexDocumentTypeMessageVO = new IndexDocumentTypeMessageVO()
			.config(config).documentType(documentType)
			.newIndexName(indexName);

	Set<ProductProperty> productPropertList = new HashSet<ProductProperty>();
	ProductProperty productProperty = new ProductProperty();
	// For now ids hard coded in generator for testing
	Long productPropertyId = 1l;
	productProperty.setId(productPropertyId);
	productProperty
			.setColor(SampleDataGeneratorService.PRODUCTPROPERTY_COLOR_BLACK);
	productProperty
			.setSize(SampleDataGeneratorService.PRODUCTPROPERTY_SIZE_13_INCH);
	productPropertList.add(productProperty);

	expect(sampleDataGeneratorService.generateProductPropertySampleData())
			.andReturn(productPropertList);
	replay(sampleDataGeneratorService);

	TestProbe testProbe = TestProbe.apply(system);
	ref.tell(indexDocumentTypeMessageVO, testProbe.ref());
	verify(sampleDataGeneratorService);

	testProbe.expectMsgClass(Integer.class);
	TestActor.Message sizeMessage = testProbe.lastMessage();
	Integer resultMsgCount = (Integer) sizeMessage.msg();
	assertEquals(1, resultMsgCount.intValue());

	testProbe.expectMsgClass(IndexDocumentVO.class);
	TestActor.Message message = testProbe.lastMessage();
	IndexDocumentVO resultMsg = (IndexDocumentVO) message.msg();
	assertEquals(productPropertyId, resultMsg.getDocumentId());
	assertEquals(config, resultMsg.getConfig());
	assertEquals(documentType, resultMsg.getDocumentType());
	assertEquals(indexName, resultMsg.getNewIndexName());
}
 
开发者ID:jaibeermalik,项目名称:searchanalytics-bigdata,代码行数:47,代码来源:DataGeneratorWorkerActorTest.java


注:本文中的org.jai.search.model.ProductProperty.setColor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。