001package io.ebean.typequery;
002
003/**
004 * Base property for number types.
005 *
006 * @param <R> the root query bean type
007 * @param <T> the number type
008 */
009@SuppressWarnings("rawtypes")
010public abstract class PBaseNumber<R,T extends Comparable> extends PBaseCompareable<R,T> {
011
012  /**
013   * Construct with a property name and root instance.
014   *
015   * @param name property name
016   * @param root the root query bean instance
017   */
018  public PBaseNumber(String name, R root) {
019    super(name , root);
020  }
021
022  /**
023   * Construct with additional path prefix.
024   */
025  public PBaseNumber(String name, R root, String prefix) {
026    super(name, root, prefix);
027  }
028
029  // Additional int versions -- seems the right thing to do
030
031  /**
032   * Is equal to.
033   *
034   * @param value the equal to bind value
035   * @return the root query bean instance
036   */
037  public R equalTo(int value) {
038    expr().eq(_name, value);
039    return _root;
040  }
041
042  /**
043   * Greater than.
044   *
045   * @param value the equal to bind value
046   * @return the root query bean instance
047   */
048  public R greaterThan(int value) {
049    expr().gt(_name, value);
050    return _root;
051  }
052
053  /**
054   * Less than.
055   *
056   * @param value the equal to bind value
057   * @return the root query bean instance
058   */
059  public R lessThan(int value) {
060    expr().lt(_name, value);
061    return _root;
062  }
063
064
065  /**
066   * Is equal to.
067   *
068   * @param value the equal to bind value
069   * @return the root query bean instance
070   */
071  public R eq(int value) {
072    expr().eq(_name, value);
073    return _root;
074  }
075
076  /**
077   * Greater than.
078   *
079   * @param value the equal to bind value
080   * @return the root query bean instance
081   */
082  public R gt(int value) {
083    expr().gt(_name, value);
084    return _root;
085  }
086
087  /**
088   * Less than.
089   *
090   * @param value the equal to bind value
091   * @return the root query bean instance
092   */
093  public R lt(int value) {
094    expr().lt(_name, value);
095    return _root;
096  }
097
098  /**
099   * Between lower and upper values.
100   *
101   * @param lower the lower bind value
102   * @param upper the upper bind value
103   * @return the root query bean instance
104   */
105  public R between(int lower, int upper) {
106    expr().between(_name, lower, upper);
107    return _root;
108  }
109}