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

liqp.nodes.NEqNode Maven / Gradle / Ivy

Go to download

A Java implementation of the Liquid templating engine backed up by an ANTLR grammar.

There is a newer version: 0.9.1.3
Show newest version
package liqp.nodes;

import liqp.LValue;

import java.util.Objects;

public class NEqNode extends ComparingExpressionNode {

    public NEqNode(LNode lhs, LNode rhs) {
        super(lhs, rhs, false);
    }

    @Override
    Object doCompare(Object a, Object b, boolean strictTypedExpressions) {
        if (a instanceof Boolean && b instanceof Boolean) {
            return !Objects.equals(a, b);
        }
        if (a instanceof Boolean) {
            return true;
        }
        if (b instanceof Boolean) {
            return true;
        }
        return !LValue.areEqual(a, b);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy