Class InvalidArgument

  • All Implemented Interfaces:
    StaticStructure, Structure, java.io.Serializable

    public class InvalidArgument
    extends Error
    implements java.io.Serializable, StaticStructure
    The InvalidArgument exception indicates that the values received for one or more parameters are not acceptable.

    This exception is reported by the API infrastructure, so it could occur in response to the invocation of any method. It may also be reported as the result of method-specific validation.

    Examples:

    • A parameter has a value that is not of the expected type.
    • A parameter has a value that is not in the required range.
    • A parameter has a value that is not one of the specifically allowed strings.
    • One property of a class is the tag for a tagged union, and has a specific value but another property of the class that is required to be specified when the tag has that value is not specified, or another property of the class that is required to be unspecified when the tag has that value is specified.

    Counterexamples:

    • Trying to create a new tag in tag category when a tag with the specified name already exists the tag category. The AlreadyExists exception would be used instead.
    • Invoke the method to retrieve information about a virtual machine, passing an id that does not identify an existing virtual machine. The NotFound exception would be used instead.
    • Attempt to put a virtual machine into a folder that can only contain hosts. The InvalidElementType exception would be used instead.
    • Attempt to attach a SCSI virtual disk to an IDE port. The InvalidElementType exception would be used instead.
    See Also:
    Serialized Form
    • Constructor Detail

      • InvalidArgument

        public InvalidArgument​(java.util.List<LocalizableMessage> messages,
                               Structure data)
        This constructor is provided for backwards compatibility purposes only. Please use the Builder class instead.
      • InvalidArgument

        public InvalidArgument()
        Default constructor.
      • InvalidArgument

        protected InvalidArgument​(StructValue __dynamicStructureFields)
      • InvalidArgument

        protected InvalidArgument​(StructValue __dynamicStructureFields,
                                  Error.Type errorType)
    • Method Detail

      • _getType

        public com.vmware.vapi.bindings.type.ErrorType _getType()
        Description copied from interface: StaticStructure
        WARNING: Internal method, subject to change in future versions. Returns StructType instance representing the static bindings type for this Structure.
        Specified by:
        _getType in interface StaticStructure
        Overrides:
        _getType in class Error
        Returns:
        the static bindings StructType
      • _getDataValue

        public StructValue _getDataValue()
        Description copied from interface: Structure
        Returns this Structure represented in the dynamic DataValue model.

        Attempts to change the returned StructValue representation are not required to change the state of this structure. Actually the behavior is implementation dependent and is unspecified. In general the returned value shouldn't be changed.

        Specified by:
        _getDataValue in interface Structure
        Overrides:
        _getDataValue in class Error
        Returns:
        StructValue representing this structure
      • _validate

        public void _validate()
        Description copied from interface: StaticStructure
        Validates the state of the discriminated unions and HasFieldsOf restrictions (if any) in this Java language binding Structure.

        More precisely, for each union: given value of the discriminant/tag field (@UnionTag in the IDL) of an union in this structure, validates that:

      • all fields of the union required for that value of the discriminant are set
      • fields of the union that are not allowed for that value of the discriminant are not set
      • any other fields of the structure (not participating in the union) do not affect the validation result
Specified by:
_validate in interface StaticStructure
Overrides:
_validate in class Error