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

org.infinispan.query.dsl.impl.OperatorAndArgument Maven / Gradle / Ivy

There is a newer version: 9.1.7.Final
Show newest version
package org.infinispan.query.dsl.impl;

import org.infinispan.query.dsl.impl.logging.Log;
import org.jboss.logging.Logger;

/**
 * @author [email protected]
 * @since 6.0
 */
abstract class OperatorAndArgument implements Visitable {

   private static final Log log = Logger.getMessageLogger(Log.class, OperatorAndArgument.class.getName());

   protected final AttributeCondition attributeCondition;

   protected final ArgumentType argument;

   protected OperatorAndArgument(AttributeCondition attributeCondition, ArgumentType argument) {
      this.attributeCondition = attributeCondition;
      this.argument = argument;
   }

   AttributeCondition getAttributeCondition() {
      return attributeCondition;
   }

   ArgumentType getArgument() {
      return argument;
   }

   //todo [anistor] must also validate that the argument type is compatible with the operator
   void validate() {
      if (argument == null) {
         throw log.argumentCannotBeNull();
      }
   }

   @Override
   public String toString() {
      return getClass().getSimpleName() + "{argument=" + argument + '}';
   }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy