1 /*
2 * Copyright 2009-2013 the original author or authors.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 package com.orangesignal.csv.filters;
18
19 import java.io.IOException;
20 import java.util.Comparator;
21
22 /**
23 * 指定された Java プログラム要素のフィールド値が判定基準値以上かどうかでフィルタを適用する Java プログラム要素フィルタの実装です。
24 *
25 * @author Koji Sugisawa
26 * @since 1.2.3
27 */
28 public class BeanGreaterThanOrEqualExpression extends BeanCriteriaExpression {
29
30 /**
31 * コンストラクタです。
32 *
33 * @param name フィールド名
34 * @param criteria 判定基準値
35 * @throws IllegalArgumentException パラメータが <code>null</code> の場合
36 */
37 protected BeanGreaterThanOrEqualExpression(final String name, final Object criteria) {
38 super(name, criteria);
39 }
40
41 /**
42 * コンストラクタです。
43 *
44 * @param name フィールド名
45 * @param criteria 判定基準値
46 * @param comparator コンパレータ (オプション)
47 * @throws IllegalArgumentException パラメータが <code>null</code> の場合
48 */
49 protected BeanGreaterThanOrEqualExpression(final String name, final Object criteria, @SuppressWarnings("rawtypes") final Comparator comparator) {
50 super(name, criteria, comparator);
51 }
52
53 @Override
54 public boolean accept(final Object bean) throws IOException {
55 return BeanExpressionUtils.ge(bean, name, criteria, comparator);
56 }
57
58 }