net.sourceforge.msscodefactory.cfbam.v2_7.CFBamMssCF.CFBamMssCFBindSecUserEMailConfirmationUuid.java Source code

Java tutorial

Introduction

Here is the source code for net.sourceforge.msscodefactory.cfbam.v2_7.CFBamMssCF.CFBamMssCFBindSecUserEMailConfirmationUuid.java

Source

// Description: Java 8 MSSCodeFactory Binding for SecUser Column EMailConfirmationUuid.

/*
 *   CFBam
 *
 *   Copyright (c) 2014-2016 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.cfbam.v2_7.CFBamMssCF;

import java.math.*;
import java.sql.*;
import java.util.*;
import net.sourceforge.msscodefactory.cflib.v2_7.CFLib.*;
import net.sourceforge.msscodefactory.cfcore.v2_7.MssCF.*;
import net.sourceforge.msscodefactory.cfsecurity.v2_7.CFSecurity.*;
import net.sourceforge.msscodefactory.cfinternet.v2_7.CFInternet.*;
import net.sourceforge.msscodefactory.cfbam.v2_7.CFBam.*;
import net.sourceforge.msscodefactory.cfbam.v2_7.CFBamObj.*;
import net.sourceforge.msscodefactory.cfsecurity.v2_7.CFSecurityObj.*;
import net.sourceforge.msscodefactory.cfinternet.v2_7.CFInternetObj.*;
import org.apache.commons.codec.binary.Base64;

/**
 *   CFBamMssCFBindSecUserEMailConfirmationUuid binds SecUser.EMailConfirmationUuid
 *   as an instance of MssCFGenBindObj.
 */
public class CFBamMssCFBindSecUserEMailConfirmationUuid extends MssCFGenBindObj {
    private static final long serialVersionUID = 1L;

    public CFBamMssCFBindSecUserEMailConfirmationUuid() {
        super();
    }

    public CFBamMssCFBindSecUserEMailConfirmationUuid(MssCFEngine argEngine) {
        super(argEngine, "any", null, "SecUser", "EMailConfirmationUuid");
    }

    public Object getValueObject(MssCFGenContext genContext) {
        final String S_ProcName = "CFBamMssCFBindSecUserEMailConfirmationUuid.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()");
        }

        UUID eMailConfirmationUuid;
        if (genDef instanceof ICFBamSecUserObj) {
            eMailConfirmationUuid = ((ICFBamSecUserObj) genDef).getOptionalEMailConfirmationUuid();
        } else {
            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), "expandBody",
                    "genContext.getGenDef()", genDef, "ICFBamSecUserObj");
        }

        return (eMailConfirmationUuid);
    }

    public String expandBody(MssCFGenContext genContext) {
        final String S_ProcName = "CFBamMssCFBindSecUserEMailConfirmationUuid.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 ICFBamSecUserObj) {
            UUID eMailConfirmationUuid = ((ICFBamSecUserObj) genDef).getOptionalEMailConfirmationUuid();
            if (eMailConfirmationUuid == null) {
                ret = null;
            } else {
                ret = eMailConfirmationUuid.toString();
            }
        } else {
            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), "expandBody",
                    "genContext.getGenDef()", genDef, "ICFBamSecUserObj");
        }

        return (ret);
    }

}