/** * Constructs a property-based comparator for beans. * This constructor creates * a BeanComparator that uses the supplied Comparator to compare * the property values. * * @param property Name of a bean property, can contain the name * of a simple, nested, indexed, mapped, or combined * property. See {@link PropertyUtilsBean} for property query language * syntax. * @param comparator BeanComparator will pass the values of the * specified bean property to this Comparator. * If your bean property is not a comparable or * contains null values, a suitable comparator * may be supplied in this constructor. */ public BeanComparator( final String property, final Comparator<?> comparator ) { setProperty( property ); if (comparator != null) { this.comparator = comparator; } else { this.comparator = ComparableComparator.getInstance(); } }
/** * Constructs a property-based comparator for beans. * This constructor creates * a BeanComparator that uses the supplied Comparator to compare * the property values. * * @param property Name of a bean property, can contain the name * of a simple, nested, indexed, mapped, or combined * property. See {@link PropertyUtilsBean} for property query language * syntax. * @param comparator BeanComparator will pass the values of the * specified bean property to this Comparator. * If your bean property is not a comparable or * contains null values, a suitable comparator * may be supplied in this constructor. */ public BeanComparator( final String property, final Comparator<?> comparator ) { setProperty( property ); if (comparator != null) { this.comparator = comparator; } else { this.comparator = ComparableComparator.getInstance(); } }
/** * Constructs a property-based comparator for beans. * This constructor creates * a BeanComparator that uses the supplied Comparator to compare * the property values. * * @param property Name of a bean property, can contain the name * of a simple, nested, indexed, mapped, or combined * property. See {@link PropertyUtilsBean} for property query language * syntax. * @param comparator BeanComparator will pass the values of the * specified bean property to this Comparator. * If your bean property is not a comparable or * contains null values, a suitable comparator * may be supplied in this constructor. */ public BeanComparator( final String property, final Comparator<?> comparator ) { setProperty( property ); if (comparator != null) { this.comparator = comparator; } else { this.comparator = ComparableComparator.getInstance(); } }
/** * Constructs a property-based comparator for beans. * This constructor creates * a BeanComparator that uses the supplied Comparator to compare * the property values. * * @param property Name of a bean property, can contain the name * of a simple, nested, indexed, mapped, or combined * property. See {@link PropertyUtilsBean} for property query language * syntax. * @param comparator BeanComparator will pass the values of the * specified bean property to this Comparator. * If your bean property is not a comparable or * contains null values, a suitable comparator * may be supplied in this constructor. */ public BeanComparator( String property, Comparator comparator ) { setProperty( property ); if (comparator != null) { this.comparator = comparator; } else { this.comparator = ComparableComparator.getInstance(); } }
/** * Constructs a property-based comparator for beans. * This constructor creates * a BeanComparator that uses the supplied Comparator to compare * the property values. * * @param property Name of a bean property, can contain the name * of a simple, nested, indexed, mapped, or combined * property. See {@link PropertyUtilsBean} for property query language * syntax. * @param comparator BeanComparator will pass the values of the * specified bean property to this Comparator. * If your bean property is not a comparable or * contains null values, a suitable comparator * may be supplied in this constructor. */ public BeanComparator( String property, Comparator comparator ) { setProperty( property ); if (comparator != null) { this.comparator = comparator; } else { this.comparator = ComparableComparator.getInstance(); } }
/** * Constructs a property-based comparator for beans. * This constructor creates * a BeanComparator that uses the supplied Comparator to compare * the property values. * * @param property Name of a bean property, can contain the name * of a simple, nested, indexed, mapped, or combined * property. See {@link PropertyUtilsBean} for property query language * syntax. * @param comparator BeanComparator will pass the values of the * specified bean property to this Comparator. * If your bean property is not a comparable or * contains null values, a suitable comparator * may be supplied in this constructor. */ public BeanComparator( String property, Comparator comparator ) { setProperty( property ); if (comparator != null) { this.comparator = comparator; } else { this.comparator = ComparableComparator.getInstance(); } }