com.landawn.abacus.condition.Limit Maven / Gradle / Ivy
/*
* Copyright (C) 2015 HaiYang Li
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.landawn.abacus.condition;
import static com.landawn.abacus.util.WD._SPACE;
import java.util.List;
import com.landawn.abacus.util.N;
import com.landawn.abacus.util.NamingPolicy;
import com.landawn.abacus.util.Strings;
import com.landawn.abacus.util.WD;
/**
*
*/
public class Limit extends AbstractCondition {
private int count;
private int offset;
private String expr;
// For Kryo
Limit() {
}
/**
* Constructor for LIMIT.
*
* @param count
*/
public Limit(final int count) {
this(0, count);
}
/**
*
*
* @param offset
* @param count
*/
public Limit(final int offset, final int count) {
super(Operator.LIMIT);
this.count = count;
this.offset = offset;
}
/**
*
*
* @param expr
*/
public Limit(final String expr) {
this(0, Integer.MAX_VALUE);
this.expr = expr;
}
/**
*
*
* @return
*/
public String getExpr() {
return expr;
}
/**
* Gets the count.
*
* @return
*/
public int getCount() {
return count;
}
/**
* Gets the offset.
*
* @return
*/
public int getOffset() {
return offset;
}
/**
* Gets the parameters.
*
* @return
*/
@Override
public List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy