All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opendaylight.ovsdb.lib.operations.Select Maven / Gradle / Ivy

/*
 * Copyright © 2014, 2017 Red Hat, Inc. and others. All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/epl-v10.html
 */

package org.opendaylight.ovsdb.lib.operations;

import java.util.ArrayList;
import java.util.List;
import org.opendaylight.ovsdb.lib.notation.Condition;
import org.opendaylight.ovsdb.lib.schema.ColumnSchema;
import org.opendaylight.ovsdb.lib.schema.TableSchema;

public class Select> extends Operation implements ConditionalOperation {

    public static final String SELECT = "select";
    private List where = new ArrayList<>();
    private List columns = new ArrayList<>();

    public Select on(TableSchema schema) {
        this.setTableSchema(schema);
        return this;
    }

    public Select(TableSchema schema) {
        super(schema, SELECT);
    }

    public > Select column(ColumnSchema columnSchema) {
        columns.add(columnSchema.getName());
        return this;
    }

    public Where where(Condition condition) {
        where.add(condition);
        return new Where(this);
    }

    public List getColumns() {
        return columns;
    }

    public void setColumns(List columns) {
        this.columns = columns;
    }

    @Override
    public void addCondition(Condition condition) {
        this.where.add(condition);
    }

    public List getWhere() {
        return where;
    }

    public void setWhere(List where) {
        this.where = where;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy