Package cellmate.cell

Examples of cellmate.cell.StringValueCell


    @BeforeClass
    public void setup() {
        writer = new MockDBCellValueWriter();

        StringValueCell cell1 = new StringValueCell("name", "brian", "info");
        StringValueCell cell2 = new StringValueCell("age", "11", "info");
        StringValueCell cell3 = new StringValueCell("height", "6ft", "info");
        CellGroup<StringValueCell> row1 = new CellGroup<StringValueCell>("row1");
        row1.addCell(cell1);
        row1.addCell(cell2);
        row1.addCell(cell3);

        CellGroup<StringValueCell> row2 = new CellGroup<StringValueCell>("row2");
        row2.addCell(cell1);
        row2.addCell(cell2);
        row2.addCell(cell3);


        StringValueCell cell4 = new StringValueCell("age", "13", "cf");
        StringValueCell cell5 = new StringValueCell("siblings", "1", "cf");
        CellGroup<StringValueCell> row3 = new CellGroup<StringValueCell>("row3");
        row3.addCell(cell4);
        row3.addCell(cell5);

        CellGroup<StringValueCell> row4 = new CellGroup<StringValueCell>("row4");
View Full Code Here


    public void nullColFam() {

        ImmutableList<CellGroup<StringValueCell>> nullColFamGroup;
        ImmutableList.Builder<CellGroup<StringValueCell>> builder3 = ImmutableList.builder();
        CellGroup<StringValueCell> row5 = new CellGroup<StringValueCell>("row5");
        row5.addCell(new StringValueCell("l","2"));
        builder3.add(row5);
        nullColFamGroup = builder3.build();

        assertEquals(nullColFamGroup.size(), 1);
        assertEquals(nullColFamGroup.get(0).getInternalList().size(), 1);
View Full Code Here

    StringValueCell tsCell2;
    StringValueCell tsCell3;

    @BeforeClass
    public void setup() {
        tsCell1 = new StringValueCell("name", "brian", 11l);
        tsCell2 = new StringValueCell("name", "brian", 22l);
        tsCell3 = new StringValueCell("name", "brian");
        cellGroup.addCell(tsCell1);
        cellGroup.addCell(tsCell2);
        cellGroup.addCell(tsCell3);
    }
View Full Code Here

    }

    @Test(dependsOnMethods = "getTimestamp")
    public void getLatestTimestamp() {
        try {
            StringValueCell cell = timestampHelper.getCellWithMostRecentTimestamp(cellGroup.getInternalList(), "ts");
            assertNotNull(cell);
            assertEquals(timestampHelper.getTimestamp(cell, "ts"), new Long(22l));
        } catch (Exception e){
            fail("failed on exception", e);
        }
View Full Code Here

        CellTransformer<MockDBResult, StringValueCell> transformer = new CellTransformer<MockDBResult, StringValueCell> () {
            public CellGroup<StringValueCell> apply(MockDBResult dbItem, CellGroup<StringValueCell> tuple) {
                if (!tuple.getTag().equals(dbItem.getId())){
                    tuple = new CellGroup<StringValueCell>(dbItem.getId());
                }
                StringValueCell cell = new StringValueCell(dbItem.getQual(), dbItem.getVal(), dbItem.getTimestamp());
                tuple.addCell(cell);
                return tuple;
            }
        };
View Full Code Here

                    String value = dbItem.getVal();
                    if(dbItem.getColFam().equals("events")) {
                        label = "event";
                        value = dbItem.getQual();
                    }
                    StringValueCell cell = new StringValueCell(label, value, dbItem.getTimestamp());
                    tuple.addCell(cell);
                    return tuple;
                }
            };
View Full Code Here

                String value = dbItem.getVal();
                if(dbItem.getColFam().equals("events")) {
                    label = "event";
                    value = dbItem.getQual();
                }
                StringValueCell cell = new StringValueCell(label, value, dbItem.getTimestamp());
                group.addCell(cell);
                return group;
            }
        };
        MockParameters parameters = new MockParameters.Builder().build();
View Full Code Here

            public CellGroup<StringValueCell> apply(MockDBResult dbItem, CellGroup<StringValueCell> cellGroup) {
                if (!cellGroup.getTag().equals(dbItem.getId())){
                    return null//null group
                }
                StringValueCell cell = new StringValueCell(dbItem.getQual(), dbItem.getVal(), dbItem.getTimestamp());
                cellGroup.addCell(cell);
                return cellGroup;
            }
        };
        try {
View Full Code Here

        CellTransformer<MockDBResult, StringValueCell> transformer = new CellTransformer<MockDBResult, StringValueCell> () {
            public CellGroup<StringValueCell> apply(MockDBResult dbItem, CellGroup<StringValueCell> tuple) {
                if (!tuple.getTag().equals(dbItem.getId())){
                    tuple = new CellGroup<StringValueCell>(dbItem.getId());
                }
                StringValueCell cell = new StringValueCell(dbItem.getQual(), dbItem.getVal(), dbItem.getTimestamp());
                tuple.addCell(cell);
                return tuple;
            }
        };
View Full Code Here

TOP

Related Classes of cellmate.cell.StringValueCell

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.