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

liqp.filters.Last Maven / Gradle / Ivy

package liqp.filters;

class Last extends Filter {

    /*
     * last(array)
     *
     * Get the last element of the passed in array
     */
    @Override
    public Object apply(Object value, Object... params) {

        Object[] array = super.asArray(value);

        return array.length == 0 ? null : super.asString(array[array.length - 1]);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy