AbstractAssert.java
/*
** Module : AbstractAssert.java
** Abstract : Common implementation parts of OpenEdge.Core.Assert and OpenEdge.Core.Assertion.AssertObject
** builtin classes.
**
** Copyright (c) 2023-2025, Golden Code Development Corporation.
**
** -#- -I- --Date-- -------------------------------Description--------------------------------
** 001 VVT 20230318 Initial release
** 002 CA 20231113 The 'execute' method must be annotated with LegacySignature Type.Execute, and also can be
** dropped if is a no-op.
** 003 ICP 20250429 Modified raiseUnknown to account for the Progress version, as the error message changes.
*/
/*
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU Affero General Public License as
** published by the Free Software Foundation, either version 3 of the
** License, or (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU Affero General Public License for more details.
**
** You may find a copy of the GNU Affero GPL version 3 at the following
** location: https://www.gnu.org/licenses/agpl-3.0.en.html
**
** Additional terms under GNU Affero GPL version 3 section 7:
**
** Under Section 7 of the GNU Affero GPL version 3, the following additional
** terms apply to the works covered under the License. These additional terms
** are non-permissive additional terms allowed under Section 7 of the GNU
** Affero GPL version 3 and may not be removed by you.
**
** 0. Attribution Requirement.
**
** You must preserve all legal notices or author attributions in the covered
** work or Appropriate Legal Notices displayed by works containing the covered
** work. You may not remove from the covered work any author or developer
** credit already included within the covered work.
**
** 1. No License To Use Trademarks.
**
** This license does not grant any license or rights to use the trademarks
** Golden Code, FWD, any Golden Code or FWD logo, or any other trademarks
** of Golden Code Development Corporation. You are not authorized to use the
** name Golden Code, FWD, or the names of any author or contributor, for
** publicity purposes without written authorization.
**
** 2. No Misrepresentation of Affiliation.
**
** You may not represent yourself as Golden Code Development Corporation or FWD.
**
** You may not represent yourself for publicity purposes as associated with
** Golden Code Development Corporation, FWD, or any author or contributor to
** the covered work, without written authorization.
**
** 3. No Misrepresentation of Source or Origin.
**
** You may not represent the covered work as solely your work. All modified
** versions of the covered work must be marked in a reasonable way to make it
** clear that the modified work is not originating from Golden Code Development
** Corporation or FWD. All modified versions must contain the notices of
** attribution required in this license.
*/
package com.goldencode.p2j.oo.core;
import static com.goldencode.p2j.report.ReportConstants.*;
import static com.goldencode.p2j.util.BlockManager.*;
import static com.goldencode.p2j.util.CompareOps.*;
import static com.goldencode.p2j.util.ErrorManager.silent;
import static com.goldencode.p2j.util.TextOps.substitute;
import java.util.function.*;
import com.goldencode.p2j.oo.core.collections.*;
import com.goldencode.p2j.oo.lang.*;
import com.goldencode.p2j.util.*;
import com.goldencode.p2j.util.InternalEntry.*;
/**
* Common implementation parts of OpenEdge.Core.Assert and OpenEdge.Core.Assertion.AssertObject
* builtin classes.
*/
@LegacyResource(resource = "OpenEdge.Core.AbstractAssert")
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_PARTIAL)
public abstract class AbstractAssert
extends BaseObject
{
/**
* Default value to use as the argument name in failure messages.
*/
protected static final String DEFAULT_ARGUMENT_NAME = "argument";
/**
* The static constructor
*/
@LegacySignature(type = Type.CONSTRUCTOR)
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void __core_AbstractAssert_constructor__static__()
{
externalProcedure(AbstractAssert.class, new Block((Body) () -> {
onBlockLevel(Condition.ERROR, Action.THROW);
}));
}
/**
* Check that the array argument has determinate extent
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "HasDeterminateExtent", parameters = {
@LegacyParameter(name = "argument", type = "CHARACTER", extent = -1, mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void hasDeterminateExtent(final character[] argument)
{
hasDeterminateExtentImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the array argument has determinate extent
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "HasDeterminateExtent", parameters = {
@LegacyParameter(name = "argument", type = "CHARACTER", extent = -1, mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void hasDeterminateExtent(final character[] argument, final character name)
{
hasDeterminateExtentImpl(argument, name.toStringMessage());
}
/**
* Check that the array argument has determinate extent
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "HasDeterminateExtent", parameters = {
@LegacyParameter(name = "argument", type = "DATE", extent = -1, mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void hasDeterminateExtent(final date[] argument)
{
hasDeterminateExtentImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the array argument has determinate extent
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "HasDeterminateExtent", parameters = {
@LegacyParameter(name = "argument", type = "DATE", extent = -1, mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void hasDeterminateExtent(final date[] argument, final character name)
{
hasDeterminateExtentImpl(argument, name.toStringMessage());
}
/**
* Check that the array argument has determinate extent
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "HasDeterminateExtent", parameters = {
@LegacyParameter(name = "argument", type = "DATETIME", extent = -1, mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void hasDeterminateExtent(final datetime[] argument)
{
hasDeterminateExtentImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the array argument has determinate extent
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "HasDeterminateExtent", parameters = {
@LegacyParameter(name = "argument", type = "DATETIME", extent = -1, mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void hasDeterminateExtent(final datetime[] argument, final character name)
{
hasDeterminateExtentImpl(argument, name.toStringMessage());
}
/**
* Check that the array argument has determinate extent
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "HasDeterminateExtent", parameters = {
@LegacyParameter(name = "argument", type = "DATETIMETZ", extent = -1, mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void hasDeterminateExtent(final datetimetz[] argument)
{
hasDeterminateExtentImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the array argument has determinate extent
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "HasDeterminateExtent", parameters = {
@LegacyParameter(name = "argument", type = "DATETIMETZ", extent = -1, mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void hasDeterminateExtent(final datetimetz[] argument, final character name)
{
hasDeterminateExtentImpl(argument, name.toStringMessage());
}
/**
* Check that the array argument has determinate extent
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "HasDeterminateExtent", parameters = {
@LegacyParameter(name = "argument", type = "DECIMAL", extent = -1, mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void hasDeterminateExtent(final decimal[] argument)
{
hasDeterminateExtentImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the array argument has determinate extent
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "HasDeterminateExtent", parameters = {
@LegacyParameter(name = "argument", type = "DECIMAL", extent = -1, mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void hasDeterminateExtent(final decimal[] argument, final character name)
{
hasDeterminateExtentImpl(argument, name.toStringMessage());
}
/**
* Check that the array argument has determinate extent
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "HasDeterminateExtent", parameters = {
@LegacyParameter(name = "argument", type = "HANDLE", extent = -1, mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void hasDeterminateExtent(final handle[] argument)
{
hasDeterminateExtentImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the array argument has determinate extent
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "HasDeterminateExtent", parameters = {
@LegacyParameter(name = "argument", type = "HANDLE", extent = -1, mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void hasDeterminateExtent(final handle[] argument, final character name)
{
hasDeterminateExtentImpl(argument, name.toStringMessage());
}
/**
* Check that the array argument has determinate extent
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "HasDeterminateExtent", parameters = {
@LegacyParameter(name = "argument", type = "INT64", extent = -1, mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void hasDeterminateExtent(final int64[] argument)
{
hasDeterminateExtentImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the array argument has determinate extent
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "HasDeterminateExtent", parameters = {
@LegacyParameter(name = "argument", type = "INT64", extent = -1, mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void hasDeterminateExtent(final int64[] argument, final character name)
{
hasDeterminateExtentImpl(argument, name.toStringMessage());
}
/**
* Check that the array argument has determinate extent
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "HasDeterminateExtent", parameters = {
@LegacyParameter(name = "argument", type = "INTEGER", extent = -1, mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void hasDeterminateExtent(final integer[] argument)
{
hasDeterminateExtentImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the array argument has determinate extent
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "HasDeterminateExtent", parameters = {
@LegacyParameter(name = "argument", type = "INTEGER", extent = -1, mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void hasDeterminateExtent(final integer[] argument, final character name)
{
hasDeterminateExtentImpl(argument, name.toStringMessage());
}
/**
* Check that the array argument has determinate extent
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "HasDeterminateExtent", parameters = {
@LegacyParameter(name = "argument", type = "LOGICAL", extent = -1, mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void hasDeterminateExtent(final logical[] argument)
{
hasDeterminateExtentImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the array argument has determinate extent
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "HasDeterminateExtent", parameters = {
@LegacyParameter(name = "argument", type = "LOGICAL", extent = -1, mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void hasDeterminateExtent(final logical[] argument, final character name)
{
hasDeterminateExtentImpl(argument, name.toStringMessage());
}
/**
* Check that the array argument has determinate extent
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "HasDeterminateExtent", parameters = {
@LegacyParameter(name = "argument", type = "LONGCHAR", extent = -1, mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void hasDeterminateExtent(final longchar[] argument)
{
hasDeterminateExtentImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the array argument has determinate extent
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "HasDeterminateExtent", parameters = {
@LegacyParameter(name = "argument", type = "LONGCHAR", extent = -1, mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void hasDeterminateExtent(final longchar[] argument, final character name)
{
hasDeterminateExtentImpl(argument, name.toStringMessage());
}
/**
* Check that the array argument has determinate extent
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "HasDeterminateExtent", parameters = {
@LegacyParameter(name = "argument", type = "MEMPTR", extent = -1, mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void hasDeterminateExtent(final memptr[] argument)
{
hasDeterminateExtentImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the array argument has determinate extent
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "HasDeterminateExtent", parameters = {
@LegacyParameter(name = "argument", type = "MEMPTR", extent = -1, mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void hasDeterminateExtent(final memptr[] argument, final character name)
{
hasDeterminateExtentImpl(argument, name.toStringMessage());
}
/**
* Check that the array argument has determinate extent
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "HasDeterminateExtent", parameters = {
@LegacyParameter(name = "argument", qualified = "progress.lang.object", type = "OBJECT", extent = -1, mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void hasDeterminateExtent(final object<? extends _BaseObject_>[] argument)
{
hasDeterminateExtentImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the array argument has determinate extent
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "HasDeterminateExtent", parameters = {
@LegacyParameter(name = "argument", qualified = "progress.lang.object", type = "OBJECT", extent = -1, mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void hasDeterminateExtent(final object<? extends _BaseObject_>[] argument,
final character name)
{
hasDeterminateExtentImpl(argument, name.toStringMessage());
}
/**
* Check that the array argument has determinate extent
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "HasDeterminateExtent", parameters = {
@LegacyParameter(name = "argument", type = "RAW", extent = -1, mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void hasDeterminateExtent(final raw[] argument)
{
hasDeterminateExtentImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the array argument has determinate extent
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "HasDeterminateExtent", parameters = {
@LegacyParameter(name = "argument", type = "RAW", extent = -1, mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void hasDeterminateExtent(final raw[] argument, final character name)
{
hasDeterminateExtentImpl(argument, name.toStringMessage());
}
/**
* Check that the array argument has determinate extent
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "HasDeterminateExtent", parameters = {
@LegacyParameter(name = "argument", type = "RECID", extent = -1, mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void hasDeterminateExtent(final recid[] argument)
{
hasDeterminateExtentImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the array argument has determinate extent
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "HasDeterminateExtent", parameters = {
@LegacyParameter(name = "argument", type = "RECID", extent = -1, mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void hasDeterminateExtent(final recid[] argument, final character name)
{
hasDeterminateExtentImpl(argument, name.toStringMessage());
}
/**
* Check that the array argument has determinate extent
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "HasDeterminateExtent", parameters = {
@LegacyParameter(name = "argument", type = "ROWID", extent = -1, mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void hasDeterminateExtent(final rowid[] argument)
{
hasDeterminateExtentImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the array argument has determinate extent
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "HasDeterminateExtent", parameters = {
@LegacyParameter(name = "argument", type = "ROWID", extent = -1, mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void hasDeterminateExtent(final rowid[] argument, final character name)
{
hasDeterminateExtentImpl(argument, name.toStringMessage());
}
/**
* Check that the class argument is an abstract class
*
* @param clazz
* The class under test
*/
@LegacySignature(type = Type.METHOD, name = "IsAbstract", parameters = {
@LegacyParameter(name = "clazz", qualified = "progress.lang.class", type = "OBJECT", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isAbstract(final object<? extends LegacyClass> clazz)
{
testClass(clazz, "IsAbstract", LegacyClass::isAbstract, "&1 is not an abstract type");
}
/**
* Check that the class argument is a final class
*
* @param clazz
* The class under test
*/
@LegacySignature(type = Type.METHOD, name = "IsFinal", parameters = {
@LegacyParameter(name = "clazz", qualified = "progress.lang.class", type = "OBJECT", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isFinal(final object<? extends LegacyClass> clazz)
{
testClass(clazz, "IsFinal", LegacyClass::isFinal, "&1 is not a final type");
}
/**
* Check that the extent of the array argument is not determinate
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "IsIndeterminateArray", parameters = {
@LegacyParameter(name = "argument", type = "CHARACTER", extent = -1, mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isIndeterminateArray(final character[] argument)
{
isIndeterminateArrayImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the extent of the array argument is not determinate
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "IsIndeterminateArray", parameters = {
@LegacyParameter(name = "argument", type = "CHARACTER", extent = -1, mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isIndeterminateArray(final character[] argument, final character name)
{
isIndeterminateArrayImpl(argument, name.toStringMessage());
}
/**
* Check that the extent of the array argument is not determinate
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "IsIndeterminateArray", parameters = {
@LegacyParameter(name = "argument", type = "DATE", extent = -1, mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isIndeterminateArray(final date[] argument)
{
isIndeterminateArrayImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the extent of the array argument is not determinate
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "IsIndeterminateArray", parameters = {
@LegacyParameter(name = "argument", type = "DATE", extent = -1, mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isIndeterminateArray(final date[] argument, final character name)
{
isIndeterminateArrayImpl(argument, name.toStringMessage());
}
/**
* Check that the extent of the array argument is not determinate
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "IsIndeterminateArray", parameters = {
@LegacyParameter(name = "argument", type = "DATETIME", extent = -1, mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isIndeterminateArray(final datetime[] argument)
{
isIndeterminateArrayImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the extent of the array argument is not determinate
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "IsIndeterminateArray", parameters = {
@LegacyParameter(name = "argument", type = "DATETIME", extent = -1, mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isIndeterminateArray(final datetime[] argument, final character name)
{
isIndeterminateArrayImpl(argument, name.toStringMessage());
}
/**
* Check that the extent of the array argument is not determinate
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "IsIndeterminateArray", parameters = {
@LegacyParameter(name = "argument", type = "DATETIMETZ", extent = -1, mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isIndeterminateArray(final datetimetz[] argument)
{
isIndeterminateArrayImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the extent of the array argument is not determinate
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "IsIndeterminateArray", parameters = {
@LegacyParameter(name = "argument", type = "DATETIMETZ", extent = -1, mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isIndeterminateArray(final datetimetz[] argument, final character name)
{
isIndeterminateArrayImpl(argument, name.toStringMessage());
}
/**
* Check that the extent of the array argument is not determinate
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "IsIndeterminateArray", parameters = {
@LegacyParameter(name = "argument", type = "DECIMAL", extent = -1, mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isIndeterminateArray(final decimal[] argument)
{
isIndeterminateArrayImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the extent of the array argument is not determinate
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "IsIndeterminateArray", parameters = {
@LegacyParameter(name = "argument", type = "DECIMAL", extent = -1, mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isIndeterminateArray(final decimal[] argument, final character name)
{
isIndeterminateArrayImpl(argument, name.toStringMessage());
}
/**
* Check that the extent of the array argument is not determinate
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "IsIndeterminateArray", parameters = {
@LegacyParameter(name = "argument", type = "HANDLE", extent = -1, mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isIndeterminateArray(final handle[] argument)
{
isIndeterminateArrayImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the extent of the array argument is not determinate
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "IsIndeterminateArray", parameters = {
@LegacyParameter(name = "argument", type = "HANDLE", extent = -1, mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isIndeterminateArray(final handle[] argument, final character name)
{
isIndeterminateArrayImpl(argument, name.toStringMessage());
}
/**
* Check that the extent of the array argument is not determinate
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "IsIndeterminateArray", parameters = {
@LegacyParameter(name = "argument", type = "INT64", extent = -1, mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isIndeterminateArray(final int64[] argument)
{
isIndeterminateArrayImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the extent of the array argument is not determinate
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "IsIndeterminateArray", parameters = {
@LegacyParameter(name = "argument", type = "INT64", extent = -1, mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isIndeterminateArray(final int64[] argument, final character name)
{
isIndeterminateArrayImpl(argument, name.toStringMessage());
}
/**
* Check that the extent of the array argument is not determinate
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "IsIndeterminateArray", parameters = {
@LegacyParameter(name = "argument", type = "INTEGER", extent = -1, mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isIndeterminateArray(final integer[] argument)
{
isIndeterminateArrayImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the extent of the array argument is not determinate
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "IsIndeterminateArray", parameters = {
@LegacyParameter(name = "argument", type = "INTEGER", extent = -1, mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isIndeterminateArray(final integer[] argument, final character name)
{
isIndeterminateArrayImpl(argument, name.toStringMessage());
}
/**
* Check that the extent of the array argument is not determinate
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "IsIndeterminateArray", parameters = {
@LegacyParameter(name = "argument", type = "LOGICAL", extent = -1, mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isIndeterminateArray(final logical[] argument)
{
isIndeterminateArrayImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the extent of the array argument is not determinate
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "IsIndeterminateArray", parameters = {
@LegacyParameter(name = "argument", type = "LOGICAL", extent = -1, mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isIndeterminateArray(final logical[] argument, final character name)
{
isIndeterminateArrayImpl(argument, name.toStringMessage());
}
/**
* Check that the extent of the array argument is not determinate
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "IsIndeterminateArray", parameters = {
@LegacyParameter(name = "argument", type = "LONGCHAR", extent = -1, mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isIndeterminateArray(final longchar[] argument)
{
isIndeterminateArrayImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the extent of the array argument is not determinate
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "IsIndeterminateArray", parameters = {
@LegacyParameter(name = "argument", type = "LONGCHAR", extent = -1, mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isIndeterminateArray(final longchar[] argument, final character name)
{
isIndeterminateArrayImpl(argument, name.toStringMessage());
}
/**
* Check that the extent of the array argument is not determinate
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "IsIndeterminateArray", parameters = {
@LegacyParameter(name = "argument", type = "MEMPTR", extent = -1, mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isIndeterminateArray(final memptr[] argument)
{
isIndeterminateArrayImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the extent of the array argument is not determinate
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "IsIndeterminateArray", parameters = {
@LegacyParameter(name = "argument", type = "MEMPTR", extent = -1, mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isIndeterminateArray(final memptr[] argument, final character name)
{
isIndeterminateArrayImpl(argument, name.toStringMessage());
}
/**
* Check that the extent of the array argument is not determinate
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "IsIndeterminateArray", parameters = {
@LegacyParameter(name = "argument", qualified = "progress.lang.object", type = "OBJECT", extent = -1, mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isIndeterminateArray(final object<? extends _BaseObject_>[] argument)
{
isIndeterminateArrayImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the extent of the array argument is not determinate
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "IsIndeterminateArray", parameters = {
@LegacyParameter(name = "argument", qualified = "progress.lang.object", type = "OBJECT", extent = -1, mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isIndeterminateArray(final object<? extends _BaseObject_>[] argument,
final character name)
{
isIndeterminateArrayImpl(argument, name.toStringMessage());
}
/**
* Check that the extent of the array argument is not determinate
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "IsIndeterminateArray", parameters = {
@LegacyParameter(name = "argument", type = "RAW", extent = -1, mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isIndeterminateArray(final raw[] argument)
{
isIndeterminateArrayImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the extent of the array argument is not determinate
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "IsIndeterminateArray", parameters = {
@LegacyParameter(name = "argument", type = "RAW", extent = -1, mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isIndeterminateArray(final raw[] argument, final character name)
{
isIndeterminateArrayImpl(argument, name.toStringMessage());
}
/**
* Check that the extent of the array argument is not determinate
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "IsIndeterminateArray", parameters = {
@LegacyParameter(name = "argument", type = "RECID", extent = -1, mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isIndeterminateArray(final recid[] argument)
{
isIndeterminateArrayImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the extent of the array argument is not determinate
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "IsIndeterminateArray", parameters = {
@LegacyParameter(name = "argument", type = "RECID", extent = -1, mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isIndeterminateArray(final recid[] argument, final character name)
{
isIndeterminateArrayImpl(argument, name.toStringMessage());
}
/**
* Check that the extent of the array argument is not determinate
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "IsIndeterminateArray", parameters = {
@LegacyParameter(name = "argument", type = "ROWID", extent = -1, mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isIndeterminateArray(final rowid[] argument)
{
isIndeterminateArrayImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the extent of the array argument is not determinate
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "IsIndeterminateArray", parameters = {
@LegacyParameter(name = "argument", type = "ROWID", extent = -1, mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isIndeterminateArray(final rowid[] argument, final character name)
{
isIndeterminateArrayImpl(argument, name.toStringMessage());
}
/**
* Check that the class argument is an interface
*
* @param clazz
* The class under test
*/
@LegacySignature(type = Type.METHOD, name = "IsInterface", parameters = {
@LegacyParameter(name = "clazz", qualified = "progress.lang.class", type = "OBJECT", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isInterface(final object<? extends LegacyClass> clazz)
{
testClass(clazz, "IsInterface", LegacyClass::isInterface, "&1 is not an interface");
}
/**
* Check that the argument is unknown
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "IsNull", parameters = {
@LegacyParameter(name = "argument", qualified = "progress.lang.object", type = "OBJECT", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isNull(final object<? extends _BaseObject_> argument)
{
isNullImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the argument is unknown
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "IsNull", parameters = {
@LegacyParameter(name = "argument", qualified = "progress.lang.object", type = "OBJECT", mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isNull(final object<? extends _BaseObject_> argument, final character name)
{
isNullImpl(argument, name.toStringMessage());
}
/**
* Check that the argument is unknown
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "IsNull", parameters = {
@LegacyParameter(name = "argument", qualified = "progress.lang.object", type = "OBJECT", extent = -1, mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isNull(final object<? extends _BaseObject_>[] argument)
{
isNullImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the argument is unknown
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "IsNull", parameters = {
@LegacyParameter(name = "argument", qualified = "progress.lang.object", type = "OBJECT", extent = -1, mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isNull(final object<? extends _BaseObject_>[] argument,
final character name)
{
isNullImpl(argument, name.toStringMessage());
}
/**
* Check that the argument is a serializable object
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "IsSerializable", parameters = {
@LegacyParameter(name = "argument", qualified = "progress.lang.object", type = "OBJECT", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isSerializable(final object<? extends _BaseObject_> argument)
{
notNullImpl(argument, DEFAULT_ARGUMENT_NAME);
call("IsSerializable", () -> {
final object<? extends LegacyClass> cls = LegacyClass.getLegacyClass(argument);
final LegacyClass ref = cls.ref();
if (!ref.isSerializable().booleanValue())
raiseError("Object &1 (of type &2) is not serializable",
argument.ref().toLegacyString(), cls.ref().getTypeName());
});
}
/**
* Check that the argument is an object of the given type
*
* @param argument
* The argument to check
* @param type
* Type enumeration to match
*/
@LegacySignature(type = Type.METHOD, name = "IsType", parameters = {
@LegacyParameter(name = "argument", type = "HANDLE", mode = "INPUT"),
@LegacyParameter(name = "type", qualified = "openedge.core.datatypeenum", type = "OBJECT", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isType(final handle argument, final object<? extends DataTypeEnum> type)
{
isTypeImpl(argument, type, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the argument is an object of the given type
*
* @param argument
* The argument to check
* @param type
* Type enumeration to match
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "IsType", parameters = {
@LegacyParameter(name = "argument", type = "HANDLE", mode = "INPUT"),
@LegacyParameter(name = "type", qualified = "openedge.core.datatypeenum", type = "OBJECT", mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isType(final handle argument,
final object<? extends DataTypeEnum> type,
final character name)
{
isTypeImpl(argument, type, name.toStringMessage());
}
/**
* Check that the argument is an object of the given type
*
* @param argument
* The argument to check
* @param clazz
* The class to match the object to
*/
@LegacySignature(type = Type.METHOD, name = "IsType", parameters = {
@LegacyParameter(name = "argument", qualified = "progress.lang.object", type = "OBJECT", mode = "INPUT"),
@LegacyParameter(name = "clazz", qualified = "progress.lang.class", type = "OBJECT", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isType(final object<? extends _BaseObject_> argument,
final object<? extends LegacyClass> clazz)
{
notNullImpl(argument, DEFAULT_ARGUMENT_NAME);
notNullImpl(clazz, "type");
call("IsType", () -> {
final object<? extends LegacyClass> effClass = ObjectOps
.typeOf(argument, LegacyClass.class).booleanValue()
? ObjectOps.cast(argument, LegacyClass.class)
: argument.ref().getLegacyClass();
final LegacyClass ref = effClass.ref();
if (!ref.isA(clazz).booleanValue())
{
raiseError("Object &1 (of type &2) is not of type &3",
argument.ref().toLegacyString(), ref.getTypeName(),
clazz.ref().getTypeName());
}
});
}
/**
* Check that the argument is an object of the given type
*
* @param argument
* The argument to check
* @param clazz
* The class to match the object to
*/
@LegacySignature(type = Type.METHOD, name = "IsType", parameters = {
@LegacyParameter(name = "argument", qualified = "progress.lang.object", type = "OBJECT", extent = -1, mode = "INPUT"),
@LegacyParameter(name = "clazz", qualified = "progress.lang.class", type = "OBJECT", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isType(final object<? extends _BaseObject_>[] argument,
final object<? extends LegacyClass> clazz)
{
call("IsType", () -> {
if (argument.length == 0)
{
raiseError("argument cannot be an indeterminate array");
}
for (int i = 0; i < argument.length; i++)
{
isType(argument[i], clazz);
}
});
}
/**
* Check that the argument is unknown
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "IsUnknown", parameters = {
@LegacyParameter(name = "argument", qualified = "progress.lang.object", type = "OBJECT", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isUnknown_(final object<? extends _BaseObject_> argument)
{
isUnknownImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the argument is unknown
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "IsUnknown", parameters = {
@LegacyParameter(name = "argument", qualified = "progress.lang.object", type = "OBJECT", mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isUnknown_(final object<? extends _BaseObject_> argument,
final character name)
{
isUnknownImpl(argument, name.toStringMessage());
}
/**
* Check that the argument is unknown
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "IsUnknown", parameters = {
@LegacyParameter(name = "argument", qualified = "progress.lang.object", type = "OBJECT", extent = -1, mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isUnknown_(final object<? extends _BaseObject_>[] argument)
{
isUnknownImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the argument is unknown
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "IsUnknown", parameters = {
@LegacyParameter(name = "argument", qualified = "progress.lang.object", type = "OBJECT", extent = -1, mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void isUnknown_(final object<? extends _BaseObject_>[] argument,
final character name)
{
isUnknownImpl(argument, name.toStringMessage());
}
/**
* Check that two arguments are equal
*
* @param expected
* The expected value
* @param actual
* The actual value
*/
@LegacySignature(type = Type.METHOD, name = "Equals", parameters = {
@LegacyParameter(name = "expected", qualified = "progress.lang.object", type = "OBJECT", mode = "INPUT"),
@LegacyParameter(name = "actual", qualified = "progress.lang.object", type = "OBJECT", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void legacyEquals(final object<? extends _BaseObject_> expected,
final object<? extends _BaseObject_> actual)
{
notUnknownImpl(expected, DEFAULT_ARGUMENT_NAME);
call("Equals", () -> {
if (!expected.ref().legacyEquals(actual).booleanValue())
{
raiseErrorForEquals("Expected: &1 but was: &2", character.valueOf(expected),
character.valueOf(actual));
}
});
}
/**
* Check that the argument is not an abstract class
*
* @param clazz
* The class under test
*/
@LegacySignature(type = Type.METHOD, name = "NotAbstract", parameters = {
@LegacyParameter(name = "clazz", qualified = "progress.lang.class", type = "OBJECT", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void notAbstract(final object<? extends LegacyClass> clazz)
{
testClass(clazz, "NotAbstract", (LegacyClass t) -> logical.not(t.isAbstract()),
"&1 is an abstract type");
}
/**
* Check that two arguments are not equal
*
* @param expected
* The expected value
* @param actual
* The actual value
*/
@LegacySignature(type = Type.METHOD, name = "NotEqual", parameters = {
@LegacyParameter(name = "expected", qualified = "progress.lang.object", type = "OBJECT", mode = "INPUT"),
@LegacyParameter(name = "actual", qualified = "progress.lang.object", type = "OBJECT", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void notEqual(final object<? extends _BaseObject_> expected,
final object<? extends _BaseObject_> actual)
{
notUnknownImpl(expected, DEFAULT_ARGUMENT_NAME);
call("NotEqual", () -> {
if (expected.ref().legacyEquals(actual).booleanValue())
{
raiseError("&1 and &2 are equal", character.valueOf(expected),
character.valueOf(actual));
}
});
}
/**
* Check that the argument is not a final class
*
* @param clazz
* The class under test
*/
@LegacySignature(type = Type.METHOD, name = "NotFinal", parameters = {
@LegacyParameter(name = "clazz", qualified = "progress.lang.class", type = "OBJECT", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void notFinal(final object<? extends LegacyClass> clazz)
{
testClass(clazz, "NotFinal", (LegacyClass t) -> logical.not(t.isFinal()),
"&1 is a final type");
}
/**
* Check that the class argument is not an interface
*
* @param clazz
* The class under test
*/
@LegacySignature(type = Type.METHOD, name = "NotInterface", parameters = {
@LegacyParameter(name = "clazz", qualified = "progress.lang.class", type = "OBJECT", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void notInterface(final object<? extends LegacyClass> clazz)
{
testClass(clazz, "NotInterface", (LegacyClass t) -> logical.not(t.isInterface()),
"&1 is an interface");
}
/**
* Check that the argument is not unknown
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "NotNull", parameters = {
@LegacyParameter(name = "argument", qualified = "progress.lang.object", type = "OBJECT", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void notNull(final object<? extends _BaseObject_> argument)
{
notNullImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the argument is not unknown
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "NotNull", parameters = {
@LegacyParameter(name = "argument", qualified = "progress.lang.object", type = "OBJECT", mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void notNull(final object<? extends _BaseObject_> argument, final character name)
{
notNullImpl(argument, name.toStringMessage());
}
/**
* Check that the argument is not unknown
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "NotNull", parameters = {
@LegacyParameter(name = "argument", qualified = "progress.lang.object", type = "OBJECT", extent = -1, mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void notNull(final object<? extends _BaseObject_>[] argument)
{
notNullImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the argument is not unknown
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "NotNull", parameters = {
@LegacyParameter(name = "argument", qualified = "progress.lang.object", type = "OBJECT", extent = -1, mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void notNull(final object<? extends _BaseObject_>[] argument,
final character name)
{
notNullImpl(argument, name.toStringMessage());
}
/**
* Check that the argument is not a serializable object
*
* @param clazz
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "NotSerializable", parameters = {
@LegacyParameter(name = "argument", qualified = "progress.lang.object", type = "OBJECT", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void notSerializable(final object<? extends _BaseObject_> clazz)
{
notNullImpl(clazz, DEFAULT_ARGUMENT_NAME);
call("NotSerializable", () -> {
final object<? extends LegacyClass> cls = LegacyClass.getLegacyClass(clazz);
final LegacyClass ref = cls.ref();
if (ref.isSerializable().booleanValue())
{
raiseError("Object &1 (of type &2) is serializable", clazz.ref().toLegacyString(),
ref.getTypeName());
}
});
}
/**
* Check that the argument is not an object of the given type
*
* @param argument
* The argument to check
* @param type
* Type enumeration to match
*/
@LegacySignature(type = Type.METHOD, name = "NotType", parameters = {
@LegacyParameter(name = "argument", type = "HANDLE", mode = "INPUT"),
@LegacyParameter(name = "type", qualified = "openedge.core.datatypeenum", type = "OBJECT", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void notType(final handle argument, final object<? extends DataTypeEnum> type)
{
notTypeImpl(argument, type, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the argument is not an object of the given type
*
* @param argument
* The argument to check
* @param type
* Type enumeration to match
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "NotType", parameters = {
@LegacyParameter(name = "argument", type = "HANDLE", mode = "INPUT"),
@LegacyParameter(name = "type", qualified = "openedge.core.datatypeenum", type = "OBJECT", mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void notType(final handle argument,
final object<? extends DataTypeEnum> type,
final character name)
{
notTypeImpl(argument, type, name.toStringMessage());
}
/**
* Check that the argument is not an object of the given type
*
* @param argument
* The argument to check
* @param clazz
* The class to match the object to
*/
@LegacySignature(type = Type.METHOD, name = "NotType", parameters = {
@LegacyParameter(name = "argument", qualified = "progress.lang.object", type = "OBJECT", mode = "INPUT"),
@LegacyParameter(name = "clazz", qualified = "progress.lang.class", type = "OBJECT", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void notType(final object<? extends _BaseObject_> argument,
final object<? extends LegacyClass> clazz)
{
notNullImpl(argument, DEFAULT_ARGUMENT_NAME);
notNullImpl(clazz, "type");
call("NotType", () -> {
final _BaseObject_ arg = argument.ref();
final LegacyClass effClass = (ObjectOps.typeOf(argument, LegacyClass.class)
.booleanValue() ? ObjectOps.cast(argument, LegacyClass.class)
: arg.getLegacyClass()).ref();
if (effClass.isA(clazz).booleanValue())
{
raiseError("Object &1 (of type &2) is of type &3", arg.toLegacyString(),
effClass.getTypeName(), clazz.ref().getTypeName());
}
});
}
/**
* Check that the argument is not unknown
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "NotUnknown", parameters = {
@LegacyParameter(name = "argument", qualified = "progress.lang.object", type = "OBJECT", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void notUnknown(final object<? extends _BaseObject_> argument)
{
notUnknownImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the argument is not unknown
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "NotUnknown", parameters = {
@LegacyParameter(name = "argument", qualified = "progress.lang.object", type = "OBJECT", mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void notUnknown(final object<? extends _BaseObject_> argument,
final character name)
{
notUnknownImpl(argument, name.toStringMessage());
}
/**
* Check that the argument is not unknown
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "NotUnknown", parameters = {
@LegacyParameter(name = "argument", qualified = "progress.lang.object", type = "OBJECT", extent = -1, mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void notUnknown(final object<? extends _BaseObject_>[] argument)
{
notUnknownImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the argument is not unknown
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "NotUnknown", parameters = {
@LegacyParameter(name = "argument", qualified = "progress.lang.object", type = "OBJECT", extent = -1, mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void notUnknown(final object<? extends _BaseObject_>[] argument,
final character name)
{
notUnknownImpl(argument, name.toStringMessage());
}
/**
* Check that the argument is neither unknown nor empty
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "NotUnknownOrEmpty", parameters = {
@LegacyParameter(name = "argument", qualified = "openedge.core.collections.icollection", type = "OBJECT", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void notUnknownOrEmptyCollection(final object<? extends Icollection> argument)
{
notNullUnknownOrEmptyImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the argument is neither unknown nor empty
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "NotUnknownOrEmpty", parameters = {
@LegacyParameter(name = "argument", qualified = "openedge.core.collections.icollection", type = "OBJECT", mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void notUnknownOrEmptyCollection(final object<? extends Icollection> argument,
final character name)
{
notNullUnknownOrEmptyImpl(argument, name.toStringMessage());
}
/**
* Check that the argument is neither unknown nor empty
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "NotUnknownOrEmpty", parameters = {
@LegacyParameter(name = "argument", qualified = "openedge.core.collections.imap", type = "OBJECT", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void notUnknownOrEmptyMap(final object<? extends Imap> argument)
{
notNullUnknownOrEmptyImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the argument is neither unknown nor empty
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
@LegacySignature(type = Type.METHOD, name = "NotUnknownOrEmpty", parameters = {
@LegacyParameter(name = "argument", qualified = "openedge.core.collections.imap", type = "OBJECT", mode = "INPUT"),
@LegacyParameter(name = "name", type = "CHARACTER", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void notUnknownOrEmptyMap(final object<? extends Imap> argument,
final character name)
{
notNullUnknownOrEmptyImpl(argument, name.toStringMessage());
}
/**
* Check that the argument is neither unknown nor empty
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "NotUnknownOrEmpty", parameters = {
@LegacyParameter(name = "argument", qualified = "progress.lang.object", type = "OBJECT", mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void notUnknownOrEmptyObject(final object<? extends _BaseObject_> argument)
{
notNullUnknownOrEmptyImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Check that the argument is neither unknown nor empty
*
* @param argument
* The argument to check
*/
@LegacySignature(type = Type.METHOD, name = "NotUnknownOrEmpty", parameters = {
@LegacyParameter(name = "argument", qualified = "progress.lang.object", type = "OBJECT", extent = -1, mode = "INPUT") })
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public static void notUnknownOrEmptyObject(final object<? extends _BaseObject_>[] argument)
{
notUnknownOrEmptyImpl(argument, DEFAULT_ARGUMENT_NAME);
}
/**
* Convenience method to execute Java code as a legacy method.
*
* @param clazz
* the legacy class the method belongs to
* @param legacyName
* legacy method name
* @param body
* method body to execute
*/
protected static void call(final Class<? extends _BaseObject_> clazz,
final String legacyName,
final Body body)
{
ObjectOps.load(clazz);
internalProcedure(clazz, legacyName, new Block(body));
}
/**
* Implementation for most legacy equals methods in this class.
*
* @param expected
* the expected value
* @param actual
* the actual value
*/
protected static void equalsImpl(final BaseDataType expected, final BaseDataType actual)
{
call("Equals", () -> {
if (!CompareOps._isEqual(expected, actual))
{
raiseErrorForEquals("Expected: &1 but was: &2", expected, actual);
}
});
}
/**
* Check that a 4gl array has determinate extent.
*
* @param argument
* the argument to check
* @param name
* the name to use in failure message
*/
protected final static void hasDeterminateExtentImpl(final BaseDataType[] argument,
final String name)
{
call("HasDeterminateExtent", () -> {
if (argument.length == 0)
{
raiseError("&1 array cannot be indeterminate", name);
}
});
}
/**
* Implementation for legacy IsAvailable methods in this class.
*
* @param h
* the handle to test
* @param name
* the argument name to report
*/
protected static void isAvailableImpl(final handle h, final String name)
{
call("IsAvailable", () -> {
if (!h.unwrapAvailable().available().booleanValue())
{
raiseError("record in buffer &1 is not available", name);
}
});
}
/**
* Implementation for legacy IsNull methods for arrays.
*
* @param argument
* the array to test
* @param name
* the argument name to report
*/
protected static void isNullImpl(final BaseDataType[] argument, final String name)
{
call("IsNull", () -> {
if (argument.length != 0)
{
raiseNotUnknown(name);
}
});
}
/**
* Implementation for legacy IsNull methods for legacy class instances.
*
* @param argument
* the object to test
* @param name
* the argument name to report
*/
protected static void isNullImpl(final object<? extends _BaseObject_> argument,
final String name)
{
call("IsNull", () -> {
if (argument.isValid().booleanValue())
{
raiseNotUnknown(name);
}
});
}
/**
* Check that the argument is an object of the given type
*
* @param argument
* The argument to check
* @param type
* Type enumeration to match
* @param name
* the argument name to report
*/
protected static void isTypeImpl(final handle argument,
final object<? extends DataTypeEnum> type,
final String name)
{
notNullImpl(argument, name);
notNullImpl(type, "Check DataType");
call("IsType", () -> {
final character s = type.ref().toLegacyString();
if (!argument.isType(s.getValue()))
{
raiseError("&1 is not of type &2", name, s);
}
});
}
/**
* Implementation for legacy IsUnknown methods for all BDTs.
*
* @param argument
* the object to test
* @param name
* the argument name to report
*/
protected static void isUnknownImpl(final BaseDataType argument, final String name)
{
call("IsUnknown", () -> {
if (!argument.isUnknown())
{
raiseNotUnknown(name);
}
});
}
/**
* Implementation for legacy IsUnknown methods for arrays.
*
* @param argument
* the array to test
* @param name
* the argument name to report
*/
protected static void isUnknownImpl(final BaseDataType[] argument, final String name)
{
call("IsUnknown", () -> {
if (argument.length != 0)
{
raiseNotUnknown(name);
}
});
}
/**
* Implementation for legacy NotEmpty methods for handles and text.
*
* @param argument
* the object to test
* @param name
* the argument name to report
*/
protected static void notEmptyImpl(final BaseDataType argument, final String name)
{
notNullImpl(argument, name);
call("NotEmpty", () -> {
if (argument instanceof handle)
{
final handle h = (handle) argument;
silent(() -> h.unwrapBuffer().findFirst());
isAvailableImpl(h, name);
}
else if (argument instanceof Text)
{
final Text t = (Text) argument;
if (TextOps.isEmpty(t))
{
raiseError("&1 cannot be empty", name);
}
}
else if (argument instanceof object)
{
final _BaseObject_ o = ((object) argument).ref();
if (o instanceof Icollection)
{
final Icollection coll = (Icollection) o;
if (coll.getSize().intValue() == 0)
{
raiseError("&1 cannot be empty: collection must have at least one entry", name);
}
}
else if (o instanceof Imap)
{
final Imap map = (Imap) o;
if (map.getSize().intValue() == 0)
{
raiseError("&1 cannot be empty: map must have at least one entry", name);
}
}
}
else if (argument instanceof memptr)
{
if (((memptr) argument).length().intValue() == 0)
{
raiseError("&1 cannot be empty", name);
}
}
});
}
/**
* Implementation for legacy NotNull methods for any BDTs.
*
* @param argument
* the object to test
* @param name
* the argument name to report
*/
protected static void notNullImpl(final BaseDataType argument, final String name)
{
call("NotNull", () -> {
if (argument == null || argument.isUnknown())
{
raiseUnknown(name);
}
});
}
/**
* Implementation for legacy IsUnknown methods for arrays.<p>
* Array is not empty, and all array element are not unknown.
*
* @param argument
* the array to test
* @param name
* the argument name to report
*/
protected static void notNullImpl(final BaseDataType[] argument, final String name)
{
call("NotNull", () -> {
if (argument.length == 0)
{
raiseUnknown(name);
}
for (int i = 0; i < argument.length; i++)
{
notNullImpl(argument[i], name);
}
});
}
/**
* Implementation for legacy NotNull methods for any legacy class instances.
*
* @param argument
* the object to test
* @param name
* the argument name to report
*/
/**
* @param argument
* @param name
*/
protected static void notNullImpl(final object<? extends _BaseObject_> argument,
final String name)
{
call("NotNull", () -> {
if (!argument.isValid().booleanValue())
{
raiseUnknown(name);
}
});
}
/**
* Common implementation for "NotNullOrEmpty" and "NotUnknownOrEmpty" methods.
*
* @param argument
* the argument under test
* @param name
* the argument name
*/
protected static void notNullUnknownOrEmptyImpl(final object<? extends _BaseObject_> argument,
final String name)
{
notUnknownImpl(argument, name);
notEmptyImpl(argument, name);
}
/**
* Check that the argument is not an object of the given type
*
* @param argument
* The argument to check
* @param type
* Type enumeration to match
*/
protected static void notTypeImpl(final handle argument,
final object<? extends DataTypeEnum> type,
final String name)
{
notNullImpl(argument, name);
notNullImpl(type, "Check DataType");
call("NotType", () -> {
if (argument.isType(type.ref().toLegacyString().getValue()))
{
raiseError("&1 cannot be of type &2", name, type.ref().toLegacyString());
}
});
}
/**
* Implementation for legacy NotUnknown methods for any BDTs.
*
* @param argument
* the object to test
* @param name
* the argument name to report
*/
protected static void notUnknownImpl(final BaseDataType argument, final String name)
{
call("NotUnknown", () -> {
if (argument.isUnknown())
{
raiseUnknown(name);
}
});
}
/**
* Implementation for legacy NotUnknown methods for arrays.
*
* @param argument
* the array to test
* @param name
* the argument name to report
*/
protected static void notUnknownImpl(final BaseDataType[] argument, final String name)
{
call("NotUnknown", () -> {
if (argument.length == 0)
{
raiseUnknown(name);
}
});
}
/**
* Common implementation for "NotNullOrEmpty" and "NotUnknownOrEmpty" methods.
*
* @param argument
* the argument under test
* @param name
* the argument name
*/
protected static void notUnknownOrEmptyImpl(object<? extends _BaseObject_>[] argument,
final String name)
{
notUnknownImpl(argument, name);
}
/**
* Raise an ERROR condition.
*
* @param substituteTemplate
* message template to format the error message with SUBSTITUTE
* @param arg1
* the first argument to format
* @param arg2
* the second argument to format
*/
protected static void raiseError(final String substituteTemplate,
final BaseDataType arg1,
final BaseDataType arg2)
{
final BaseDataType[] args = { arg1, arg2 };
final character message = substitute(substituteTemplate, (Object[]) args);
final object<AssertionFailedError> instance = ObjectOps
.newInstance(AssertionFailedError.class, "I", message);
// See #6963.
if (!instance._isValid())
{
returnError(ObjectOps.newInstance(AssertionFailedError.class, "I", new character(
"Cannot create AssertionFailedError object. See #6963. Original message was: "
+ message)));
}
returnError(instance);
}
/**
* Raise an ERROR condition.<p>
* This method is assumed to be used in Assert:Equals and Assert:NotEqual
* implementations, where two arguments are expected and actual values.
*
* @param substituteTemplate
* message template to format the error message with SUBSTITUTE
* @param arg1
* the expected value)
* @param arg2
* the the actual value
*/
protected static void raiseErrorForEquals(final String substituteTemplate,
final BaseDataType arg1,
final BaseDataType arg2)
{
final BaseDataType[] args = { arg1, arg2 };
final character message = substitute(substituteTemplate, (Object[]) args);
final object<AssertionFailedError> instance = ObjectOps
.newInstance(AssertionFailedError.class, "III", message, arg1, arg2);
// See #6963.
if (!instance._isValid())
{
returnError(ObjectOps.newInstance(AssertionFailedError.class, "I", new character(
"Cannot create AssertionFailedError object. See #6963. Original message was: "
+ message)));
}
returnError(instance);
}
/**
* Format error string and raise {@link AssertionFailedError}.
*
* @param template
* the format string compatible with legacy SUBSTITUTE function
* @param args
* arguments to pass to SUBSTITUTE
*/
protected static void raiseError(final String template, Object... args)
{
raiseError(substitute(template, args));
}
/**
* Raise {@link AssertionFailedError}.
*
* @param msg
* the error message
*/
protected static void raiseError(final character msg)
{
returnError(ObjectOps.newInstance(AssertionFailedError.class, "II", msg, 0));
}
/**
* Raise an {@link AssertionFailedError} for IsUnknown and IsNull methods.
*
* @param name
* the argument name to report
*/
protected static void raiseNotUnknown(final String name)
{
raiseError("&1 must be unknown", name);
}
/**
* Raise an {@link AssertionFailedError} for NotUnknown and NotNull methods.
*
* @param name
* the argument name to report
*/
protected static void raiseUnknown(final String name)
{
if (_isGreaterThanOrEqual(new decimal(EnvironmentOps.getVersion()), decimal.fromLiteral("12.0")))
{
raiseError("&1 cannot be unknown", name);
}
else
{
raiseError("&1 cannot be null", name);
}
}
/**
* Check a class for the given condition.
*
* @param clazz
* The class under test
* @param method
* name of the method
* @param test
* the tester function
* @param message
* the failure message template, SUBSTITUTE compatible
*/
protected static void testClass(final object<? extends LegacyClass> clazz,
final String method,
final Function<LegacyClass, logical> test,
final String message)
{
notNullImpl(clazz, "Type");
call(method, () -> {
final LegacyClass ref = clazz.ref();
if (!test.apply(ref).booleanValue())
{
raiseError(message, ref.getTypeName());
}
});
}
/**
* Implementation helper for all test methods in this very class.
*
* @param legacyName
* the legacy name of the method
* @param body
* the method body
*/
private static void call(final String legacyName, final Body body)
{
call(AbstractAssert.class, legacyName, body);
}
/**
* Check that the extent of the array argument is determinate.
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
private static void hasDeterminateExtentImpl(object<? extends _BaseObject_>[] argument,
String name)
{
call("HasDeterminateExtent", () -> {
if (ArrayAssigner.lengthOf(argument).isUnknown())
raiseError("&1 array cannot be indeterminate", name);
});
}
/**
* Check that the extent of the array argument is not determinate
*
* @param argument
* The argument to check
* @param name
* The name of the argument
*/
private static void isIndeterminateArrayImpl(final Object[] argument, final String name)
{
call("IsIndeterminateArray", () -> {
if (argument.length > 0)
{
raiseError("&1 array must be indeterminate", name);
}
});
}
/**
* The "default" constructor.
*/
@LegacySignature(type = Type.CONSTRUCTOR)
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
public void __core_AbstractAssert_constructor__()
{
internalProcedure(this, "__core_AbstractAssert_constructor__", new Block((Body) () -> {
__lang_BaseObject_constructor__();
}));
}
/**
* Initialize this procedure
*/
@LegacySignature(type = Type.EXECUTE)
public void __core_AbstractAssert_execute__()
{
onBlockLevel(Condition.ERROR, Action.THROW);
}
}