Class IvmlComparisonOperationDescriptor

  • All Implemented Interfaces:
    IMetaOperation

    public class IvmlComparisonOperationDescriptor
    extends IvmlOperationDescriptor
    Implements equality and unequality for the dynamic types.
    Author:
    Holger Eichelberger
    • Field Detail

      • equality

        private boolean equality
    • Constructor Detail

      • IvmlComparisonOperationDescriptor

        IvmlComparisonOperationDescriptor()
        For serialization.
      • IvmlComparisonOperationDescriptor

        IvmlComparisonOperationDescriptor​(TypeDescriptor<?> declaringType,
                                          java.lang.String name,
                                          boolean equality,
                                          TypeDescriptor<?> paramType)
        Creates a new comparison operation descriptor.
        Parameters:
        declaringType - the declaring type
        name - the name of the operation (in order to consider aliases)
        equality - whether equality or unequality shall be handled by the descriptor
        paramType - the type of the parameter (values must be a subclass of IVilType)
    • Method Detail

      • isCompatible

        public IMetaOperation.CompatibilityResult isCompatible​(java.lang.Class<?> retType,
                                                               java.lang.Object... params)
        Description copied from interface: IMetaOperation
        Returns whether the operation represented by this instance is compatible to the given return type and parameters. This method does not consider possible unnamed parameter rather than the underlying Java parameter.
        Parameters:
        retType - the return type (may be null in order to ignore this parameter)
        params - the parameters (may be null if there are none, may be classes)
        Returns:
        an instance of IMetaOperation.CompatibilityResult denoting the actual compatibility level
      • getValue

        private static java.lang.Object getValue​(java.lang.Object obj)
        Turns an obj into a value, considering DecisionVariable and IvmlElement casts.
        Parameters:
        obj - the object to be turned into a value
        Returns:
        the value, may be obj