本文整理汇总了Java中org.jai.search.model.ProductProperty.setId方法的典型用法代码示例。如果您正苦于以下问题:Java ProductProperty.setId方法的具体用法?Java ProductProperty.setId怎么用?Java ProductProperty.setId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jai.search.model.ProductProperty
的用法示例。
在下文中一共展示了ProductProperty.setId方法的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;
}
示例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;
}
示例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;
}
示例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());
}
示例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());
}