Package net.sf.ehcache.search.attribute

Examples of net.sf.ehcache.search.attribute.AttributeType


    public boolean execute(Element e, Map<String, AttributeExtractor> attributeExtractors) {
        Object attributeValue = attributeExtractors.get(attributeName).attributeFor(e, getAttributeName());
        if (attributeValue == null) {
            return false;
        } else {
            AttributeType attrType = AttributeType.typeFor(getAttributeName(), attributeValue);
            if (!getType().equals(attrType)) {
                throw new SearchException("Expecting attribute of type " + getType().name() + " but was " + attrType.name());
            }

            if (getType().equals(AttributeType.STRING)) {
                return ((String) this.value).equalsIgnoreCase((String) attributeValue);
            } else {
View Full Code Here


    private static AttributeType computeType(String attributeName, Object min, Object max) {
        if ((min == null) || (max == null)) {
            throw new NullPointerException();
        }

        AttributeType minType = AttributeType.typeFor(attributeName, min);
        AttributeType maxType = AttributeType.typeFor(attributeName, max);

        if (minType != maxType) {
            throw new SearchException("Different types for min (" + minType + ") and max (" + maxType + ")");
        }
View Full Code Here

    private AttributeType verifyCommonType() {
        if (values.isEmpty()) {
            throw new AssertionError();
        }

        AttributeType rv = null;
        for (Object value : values) {
            if (value == null) {
                throw new NullPointerException("null element in set");
            }

            AttributeType at = AttributeType.typeFor(attributeName, value);
            if (rv == null) {
                rv = at;
            } else if (at != rv) {
                throw new SearchException("Multiple types detected in collection: " + at + " and " + rv);
            }
View Full Code Here

        Object attrValue = attributeExtractors.get(attributeName).attributeFor(e, attributeName);
        if (attrValue == null) {
            return false;
        } else {
            AttributeType attrType = AttributeType.typeFor(getAttributeName(), attrValue);
            if (!type.equals(attrType)) {
                throw new SearchException("Expecting attribute of type " + type.name() + " but was " + attrType.name());
            }
            if (AttributeType.STRING.equals(type)) {
                for (Object o : values) {
                    if (attrValue.toString().equalsIgnoreCase(o.toString())) {
                        return true;
View Full Code Here

    public boolean execute(Element e, Map<String, AttributeExtractor> attributeExtractors) {
        Object attrValue = attributeExtractors.get(getAttributeName()).attributeFor(e, getAttributeName());
        if (attrValue == null) {
            return false;
        } else {
            AttributeType attrType = AttributeType.typeFor(getAttributeName(), attrValue);
            if (!getType().equals(attrType)) {
                throw new SearchException("Expecting attribute of type " + getType().name() + " but was " + attrType.name());
            }

            if (getType().equals(AttributeType.STRING)) {
                return executeComparableString((Comparable) attrValue);
            } else {
View Full Code Here

TOP

Related Classes of net.sf.ehcache.search.attribute.AttributeType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.