001/* 002 * (C) Copyright 2006-2007 Nuxeo SA (http://nuxeo.com/) and others. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 * 016 * Contributors: 017 * Nuxeo - initial API and implementation 018 * 019 * $Id: QueryResultImpl.java 20796 2007-06-19 09:52:03Z sfermigier $ 020 */ 021 022package org.nuxeo.ecm.platform.relations.api.impl; 023 024import java.util.List; 025import java.util.Map; 026 027import org.nuxeo.ecm.platform.relations.api.Node; 028import org.nuxeo.ecm.platform.relations.api.QueryResult; 029 030/** 031 * Query results. 032 * 033 * @author <a href="mailto:at@nuxeo.com">Anahide Tchertchian</a> 034 */ 035public class QueryResultImpl implements QueryResult { 036 037 private static final long serialVersionUID = 1L; 038 039 protected Integer count; 040 041 protected List<String> variableNames; 042 043 protected List<Map<String, Node>> results; 044 045 /** 046 * Constructor for query result. 047 * 048 * @param count integer number of results 049 * @param variableNames list of variable names as requested in query 050 * @param results list of variable names/nodes found mapping 051 */ 052 public QueryResultImpl(Integer count, List<String> variableNames, List<Map<String, Node>> results) { 053 this.count = count; 054 this.variableNames = variableNames; 055 this.results = results; 056 } 057 058 @Override 059 public Integer getCount() { 060 return count; 061 } 062 063 @Override 064 public void setCount(Integer count) { 065 this.count = count; 066 } 067 068 @Override 069 public List<Map<String, Node>> getResults() { 070 return results; 071 } 072 073 @Override 074 public void setResults(List<Map<String, Node>> results) { 075 this.results = results; 076 } 077 078 @Override 079 public List<String> getVariableNames() { 080 return variableNames; 081 } 082 083 @Override 084 public void setVariableNames(List<String> variableNames) { 085 this.variableNames = variableNames; 086 } 087 088}