net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskMssCF.CFAsteriskMssCFBindAuditActionAuditActionId.java Source code

Java tutorial

Introduction

Here is the source code for net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskMssCF.CFAsteriskMssCFBindAuditActionAuditActionId.java

Source

// Description: Java 8 MSSCodeFactory Binding for AuditAction Column AuditActionId.

/*
 *   Code Factory Asterisk 11 Configuration Model
 *
 *   Copyright (c) 2014-2015 Mark Sobkow
 *   
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *   
 *       http://www.apache.org/licenses/LICENSE-2.0
 *   
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 *   
 */

package net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskMssCF;

import java.math.*;
import java.sql.*;
import java.util.*;
import net.sourceforge.msscodefactory.cflib.v2_3.CFLib.*;
import net.sourceforge.msscodefactory.cfcore.v2_3.MssCF.*;
import net.sourceforge.msscodefactory.cfsecurity.v2_4.CFSecurity.*;
import net.sourceforge.msscodefactory.cfinternet.v2_4.CFInternet.*;
import net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsterisk.*;
import net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskObj.*;
import net.sourceforge.msscodefactory.cfsecurity.v2_4.CFSecurityObj.*;
import net.sourceforge.msscodefactory.cfinternet.v2_4.CFInternetObj.*;
import org.apache.commons.codec.binary.Base64;

/**
 *   CFAsteriskMssCFBindAuditActionAuditActionId binds AuditAction.AuditActionId
 *   as an instance of MssCFGenBindObj.
 */
public class CFAsteriskMssCFBindAuditActionAuditActionId extends MssCFGenBindObj {
    private static final long serialVersionUID = 1L;

    public CFAsteriskMssCFBindAuditActionAuditActionId() {
        super();
    }

    public CFAsteriskMssCFBindAuditActionAuditActionId(MssCFEngine argEngine) {
        super(argEngine, "any", null, "AuditAction", "AuditActionId");
    }

    public Object getValueObject(MssCFGenContext genContext) {
        final String S_ProcName = "CFAsteriskMssCFBindAuditActionAuditActionId.getValueObject() ";

        if (genContext == null) {
            throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1,
                    "genContext");
        }

        ICFLibAnyObj genDef = genContext.getGenDef();
        if (genDef == null) {
            throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1,
                    "genContext.getGenDef()");
        }

        short auditActionId;
        if (genDef instanceof ICFAsteriskAuditActionObj) {
            auditActionId = ((ICFAsteriskAuditActionObj) genDef).getRequiredAuditActionId();
        } else {
            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), "expandBody",
                    "genContext.getGenDef()", genDef, "ICFAsteriskAuditActionObj");
        }

        return (auditActionId);
    }

    public String expandBody(MssCFGenContext genContext) {
        final String S_ProcName = "CFAsteriskMssCFBindAuditActionAuditActionId.expandBody() ";

        if (genContext == null) {
            throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1,
                    "genContext");
        }

        ICFLibAnyObj genDef = genContext.getGenDef();
        if (genDef == null) {
            throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1,
                    "genContext.getGenDef()");
        }

        String ret;

        if (genDef instanceof ICFAsteriskAuditActionObj) {
            short auditActionId = ((ICFAsteriskAuditActionObj) genDef).getRequiredAuditActionId();
            ret = Short.toString(auditActionId);
        } else {
            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), "expandBody",
                    "genContext.getGenDef()", genDef, "ICFAsteriskAuditActionObj");
        }

        return (ret);
    }

}