ControlAgentHelper.java 2.23 KB
/*
 * Decompiled with CFR 0_118.
 */
package com.adobe.service;

import com.adobe.service.ControlAgent;
import com.adobe.service._ControlAgentStub;
import org.omg.CORBA.*;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.ObjectImpl;
import org.omg.CORBA.portable.OutputStream;

public final class ControlAgentHelper {
    public static void insert(Any any, ControlAgent s) {
        any.insert_Object(s);
    }

    public static ControlAgent extract(Any any) {
        return ControlAgentHelper.narrow(any.extract_Object());
    }

    public static TypeCode type() {
        return ORB.init().create_interface_tc("IDL:com/adobe/service/ControlAgent:1.0", "ControlAgent");
    }

    public static String id() {
        return "IDL:com/adobe/service/ControlAgent:1.0";
    }

    public static ControlAgent read(InputStream in) {
        return ControlAgentHelper.narrow(in.read_Object());
    }

    public static void write(OutputStream _out, ControlAgent s) {
        _out.write_Object(s);
    }

    public static ControlAgent narrow(java.lang.Object obj) {
        if (obj instanceof ControlAgent) {
            return (ControlAgent)obj;
        }
        if (obj instanceof Object) {
            return ControlAgentHelper.narrow((Object)obj);
        }
        throw new BAD_PARAM("Failed to narrow in helper");
    }

    public static ControlAgent narrow(Object obj) {
        if (obj == null) {
            return null;
        }
        try {
            return (ControlAgent)obj;
        }
        catch (ClassCastException c) {
            if (obj._is_a("IDL:com/adobe/service/ControlAgent:1.0")) {
                _ControlAgentStub stub = new _ControlAgentStub();
                stub._set_delegate(((ObjectImpl)obj)._get_delegate());
                return stub;
            }
            throw new BAD_PARAM("Narrow failed");
        }
    }

    public static ControlAgent unchecked_narrow(Object obj) {
        if (obj == null) {
            return null;
        }
        try {
            return (ControlAgent)obj;
        }
        catch (ClassCastException c) {
            _ControlAgentStub stub = new _ControlAgentStub();
            stub._set_delegate(((ObjectImpl)obj)._get_delegate());
            return stub;
        }
    }
}