HEX
Server: Apache
System: Linux 185.122.168.184.host.secureserver.net 5.14.0-570.60.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Nov 5 05:00:59 EST 2025 x86_64
User: barbeatleanalyti (1024)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/lib/fm-agent/dependencies/linux/python3.9/jpype/__pycache__/_jobject.cpython-39.pyc
a

��i�@s@ddlZdgZGdd�dejdd�Zdd�Zd
dd	�Zee_dS)�N�JObjectc@seZdZdZdd�ZdS)ra� Base class for all object instances.

    It can be used to test if an object is a Java object instance with
    ``isinstance(obj, JObject)``.

    Calling ``JObject`` as a function can be used to covert or cast to
    specific Java type.  It will box primitive types and supports an
    option type to box to.

    This wrapper functions in three ways.

      - If the no type is given the object is automatically
        cast to type best matched given the value.  This can be used
        to create a boxed primitive.  ``JObject(JInt(i))``

      - If the type is a primitve, the object will be the boxed type of that
        primitive.  ``JObject(1, JInt)``

      - If the type is a Java class and the value is a Java object, the
        object will be cast to the Java class and will be an exact match to
        the class for the purposes of matching arguments. If the object
        is not compatible, an exception will be raised.

    Args:
       value: The value to be cast into an Java object.
       type(Optional, type): The type to cast into.

    Raises:
       TypeError: If the object cannot be cast to the specified type, or
         the requested type is not a Java class or primitive.

    cOs"t|�dkrt��St|i|��S)Nr)�len�_jpype�_java_lang_Object�_JObjectFactory)�cls�args�kwargs�r
�@/usr/lib/fm-agent/dependencies/linux/python3.9/jpype/_jobject.py�__new__8szJObject.__new__N)�__name__�
__module__�__qualname__�__doc__rr
r
r
rrs T)�internalcCsht|�}ztj|WSty&Yn0t|tj�r8|Sz|jWStyRYn0td�	|j
���dS)z� Determine the type of the object based the type of a value.

        Python primitives - lookup the type in the table
        Java primitive - lookup boxed type in the table
        Java objects - just use their type directly

    z-Unable to determine the default type of `{0}`N)�typer�_object_classes�KeyError�
isinstance�_JClass�
__javaclass__�AttributeError�	TypeError�formatr
)�obj�tpr
r
r�_getDefaultJavaObject>s
�rcCs�|durt|�}nt|t�r&t�|�}|tjvr^t|tj�sTddl}|jdtdd�tj|}t|tj	�rt|�
|�Std|��dS)z� Creates a Java object.

    If not specified type is determined based on the object.
    If type type is specified then then it tried to box it.
    Nrz/Using JObject with a Python type is deprecated.�)�category�
stacklevelz(Invalid type conversion to %s requested.)rr�strr�JClassr�warnings�warn�DeprecationWarningr�_castr)�vrr#r
r
rr[s



�

r)NN)r�__all__�_JObjectrrrr
r
r
r�<module>s
'