Examples of PropertyFilter


Examples of org.apache.accumulo.core.conf.AccumuloConfiguration.PropertyFilter

  @Test
  public void testGetProperties_NoChildren() {
    Map<String,String> props = new java.util.HashMap<String,String>();
    AccumuloConfiguration parent = createMock(AccumuloConfiguration.class);
    PropertyFilter filter = createMock(PropertyFilter.class);
    parent.getProperties(props, filter);
    replay(parent);
    expect(zc.getChildren(PATH)).andReturn(null);
    replay(zc);
View Full Code Here

Examples of org.apache.accumulo.core.conf.AccumuloConfiguration.PropertyFilter

  @Test
  public void testGetProperties_Filter() {
    Map<String,String> props = new java.util.HashMap<String,String>();
    AccumuloConfiguration parent = createMock(AccumuloConfiguration.class);
    PropertyFilter filter = createMock(PropertyFilter.class);
    parent.getProperties(props, filter);
    replay(parent);
    String child1 = "child1";
    List<String> children = new java.util.ArrayList<String>();
    children.add(child1);
    expect(zc.getChildren(PATH)).andReturn(children);
    replay(zc);
    expect(filter.accept(child1)).andReturn(false);
    replay(filter);

    a.getProperties(props, PATH, filter, parent, null);
    assertEquals(0, props.size());
  }
View Full Code Here

Examples of org.apache.stanbol.reasoners.jena.filters.PropertyFilter

     * @param data
     * @return
     */
    protected Set<Statement> classify(Model data) {
        log.debug(" classify(Model data)");
        return run(data).listStatements().filterKeep(new PropertyFilter(RDF.type)).toSet();
    }
View Full Code Here

Examples of org.apache.stanbol.reasoners.jena.filters.PropertyFilter

     * @param rules
     * @return
     */
    protected Set<Statement> classify(Model data, List<Rule> rules) {
        log.debug(" classify(Model data, List<Rule> rules)");
        return run(data, rules).listStatements().filterKeep(new PropertyFilter(RDF.type)).toSet();
    }
View Full Code Here

Examples of org.apache.stanbol.reasoners.jena.filters.PropertyFilter

  private static final Logger log = LoggerFactory
      .getLogger(PropertyFilterTest.class);

  @Test
  public void test() {
    PropertyFilter filter = new PropertyFilter(
        TestData.foaf_firstname);
    log.info("Testing the {} class", filter.getClass());
    Set<Statement> output = TestData.alexdma.getModel().listStatements()
        .filterKeep(filter).toSet();
    for(Statement statement : output){
      assertTrue(statement.getPredicate().equals(TestData.foaf_firstname));
    }
View Full Code Here

Examples of org.b3log.latke.repository.PropertyFilter

     * @throws ServiceException service exception
     */
    public JSONObject getOptions(final String category) throws ServiceException {
        final Query query = new Query();

        query.setFilter(new PropertyFilter(Option.OPTION_CATEGORY, FilterOperator.EQUAL, category));

        try {
            final JSONObject result = optionRepository.get(query);
            final JSONArray options = result.getJSONArray(Keys.RESULTS);

View Full Code Here

Examples of org.b3log.latke.repository.PropertyFilter

    @Override
    public JSONObject getByEmail(final String email) throws RepositoryException {
        final Query query = new Query().setPageCount(1);

        query.setFilter(new PropertyFilter(User.USER_EMAIL, FilterOperator.EQUAL, email.toLowerCase().trim()));

        final JSONObject result = get(query);
        final JSONArray array = result.optJSONArray(Keys.RESULTS);

        if (0 == array.length()) {
View Full Code Here

Examples of org.b3log.latke.repository.PropertyFilter

        return array.optJSONObject(0);
    }

    @Override
    public JSONObject getAdmin() throws RepositoryException {
        final Query query = new Query().setFilter(new PropertyFilter(User.USER_ROLE, FilterOperator.EQUAL, Role.ADMIN_ROLE)).setPageCount(1);
        final JSONObject result = get(query);
        final JSONArray array = result.optJSONArray(Keys.RESULTS);

        if (0 == array.length()) {
            return null;
View Full Code Here

Examples of org.b3log.latke.repository.PropertyFilter

    }

    @Override
    public JSONObject getByAuthorEmail(final String authorEmail, final int currentPageNum, final int pageSize)
        throws RepositoryException {
        final Query query = new Query().setFilter(CompositeFilterOperator.and(new PropertyFilter(Article.ARTICLE_AUTHOR_EMAIL, FilterOperator.EQUAL, authorEmail), new PropertyFilter(Article.ARTICLE_IS_PUBLISHED, FilterOperator.EQUAL, true))).addSort(Article.ARTICLE_UPDATE_DATE, SortDirection.DESCENDING).addSort(Article.ARTICLE_PUT_TOP, SortDirection.DESCENDING).setCurrentPageNum(currentPageNum).setPageSize(pageSize).setPageCount(
            1);

        return get(query);
    }
View Full Code Here

Examples of org.b3log.latke.repository.PropertyFilter

        return get(query);
    }

    @Override
    public JSONObject getByPermalink(final String permalink) throws RepositoryException {
        final Query query = new Query().setFilter(new PropertyFilter(Article.ARTICLE_PERMALINK, FilterOperator.EQUAL, permalink)).setPageCount(
            1);

        final JSONObject result = get(query);
        final JSONArray array = result.optJSONArray(Keys.RESULTS);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.