/*
 * Copyright (c) 2014-2021, by Alex Leigh.
 * All rights reserved.
 *
 * THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE
 * The copyright notice above does not evidence any
 * actual or intended publication of such source code.
 */

package leigh.esp.sdk.service.schema.v1;

import leigh.eo.EO;

/**
 * This is a dynamically generated DAO class for accessing objects within an ESP graph. This class
 * has been generated by <code>DAOGenerator</code> and should not be modified.
 *
 * @author DAOGenerator (synthetically generated class)
 */
public final class MicroServiceCfgElementDAO {
    public static final String API_TYPE = "leigh.esp.sdk.service.v1.MicroServiceCfg";

    public static EO create() {
        EO eo = new EO(API_TYPE);
        return eo;
    }

    public static boolean assertType(final EO eo) {
        return eo.getApiType().equals(API_TYPE);
    }

    public static final String KEY_KABEURL = "kabeUrl";
    public static final String KEY_SRCURI = "srcUri";
    public static final String KEY_LISTENPORT = "listenPort";

    public static String apiType(final EO eo) {
        return eo.getApiType();
    }


    /* EO{typeName='org.a6v.esp.eo.schema.Field', data={apiName=kabeUrl, validators=EOLoop{array=[EO{typeName='org.a6v.esp.eo.schema.ValidatorNotEmpty', data={}}]} , label=EOLoop{array=[EO{typeName='leigh.esp.eo.schema.Text', data={text=Kabe URL, locale=en}}]} , type=string}} */


    public static java.lang.String getKabeUrl(EO eo) {
        if (!assertType(eo))
            throw new IllegalArgumentException("Mismatched EO type: [found: " + eo.getApiType() + "] [expected: " + API_TYPE + "]");
        return eo.getValueString(KEY_KABEURL);

    }

    public static void setKabeUrl(final EO eo, java.lang.String value) {
        if (!assertType(eo))
            throw new IllegalArgumentException("Mismatched EO type: [found: " + eo.getApiType() + "] [expected: " + API_TYPE + "]");
        eo.setValue(KEY_KABEURL, value);
    }

    public static void setIfUnsetKabeUrl(final EO eo, java.lang.String value) {
        if (!assertType(eo))
            throw new IllegalArgumentException("Mismatched EO type: [found: " + eo.getApiType() + "] [expected: " + API_TYPE + "]");
        eo.setValueIfUnset(KEY_KABEURL, value);
    }



    /* EO{typeName='org.a6v.esp.eo.schema.Field', data={apiName=srcUri, validators=EOLoop{array=[EO{typeName='org.a6v.esp.eo.schema.ValidatorNotEmpty', data={}}]} , label=EOLoop{array=[EO{typeName='leigh.esp.eo.schema.Text', data={text=Source URI, locale=en}}]} , type=string}} */


    public static java.lang.String getSrcUri(EO eo) {
        if (!assertType(eo))
            throw new IllegalArgumentException("Mismatched EO type: [found: " + eo.getApiType() + "] [expected: " + API_TYPE + "]");
        return eo.getValueString(KEY_SRCURI);

    }

    public static void setSrcUri(final EO eo, java.lang.String value) {
        if (!assertType(eo))
            throw new IllegalArgumentException("Mismatched EO type: [found: " + eo.getApiType() + "] [expected: " + API_TYPE + "]");
        eo.setValue(KEY_SRCURI, value);
    }

    public static void setIfUnsetSrcUri(final EO eo, java.lang.String value) {
        if (!assertType(eo))
            throw new IllegalArgumentException("Mismatched EO type: [found: " + eo.getApiType() + "] [expected: " + API_TYPE + "]");
        eo.setValueIfUnset(KEY_SRCURI, value);
    }



    /* EO{typeName='org.a6v.esp.eo.schema.Field', data={apiName=listenPort, validators=EOLoop{array=[EO{typeName='org.a6v.esp.eo.schema.ValidatorNotEmpty', data={}}]} , label=EOLoop{array=[EO{typeName='leigh.esp.eo.schema.Text', data={text=Local Listen Port Number, locale=en}}]} , type=number}} */


    public static void setListenPort(final EO eo, int value) {
        if (!assertType(eo))
            throw new IllegalArgumentException("Mismatched EO type: [found: " + eo.getApiType() + "] [expected: " + API_TYPE + "]");
        eo.setValue(KEY_LISTENPORT, value);
    }

    public static void setListenPort(final EO eo, float value) {
        if (!assertType(eo))
            throw new IllegalArgumentException("Mismatched EO type: [found: " + eo.getApiType() + "] [expected: " + API_TYPE + "]");
        eo.setValue(KEY_LISTENPORT, value);
    }

    public static void setListenPort(final EO eo, double value) {
        if (!assertType(eo))
            throw new IllegalArgumentException("Mismatched EO type: [found: " + eo.getApiType() + "] [expected: " + API_TYPE + "]");
        eo.setValue(KEY_LISTENPORT, value);
    }

    public static void setListenPort(final EO eo, long value) {
        if (!assertType(eo))
            throw new IllegalArgumentException("Mismatched EO type: [found: " + eo.getApiType() + "] [expected: " + API_TYPE + "]");
        eo.setValue(KEY_LISTENPORT, value);
    }

    public static void setListenPort(final EO eo, short value) {
        if (!assertType(eo))
            throw new IllegalArgumentException("Mismatched EO type: [found: " + eo.getApiType() + "] [expected: " + API_TYPE + "]");
        eo.setValue(KEY_LISTENPORT, value);
    }

    public static java.math.BigDecimal getListenPort(EO eo) {
        if (!assertType(eo))
            throw new IllegalArgumentException("Mismatched EO type: [found: " + eo.getApiType() + "] [expected: " + API_TYPE + "]");
        return eo.getNumber(KEY_LISTENPORT);

    }

    public static void setListenPort(final EO eo, java.math.BigDecimal value) {
        if (!assertType(eo))
            throw new IllegalArgumentException("Mismatched EO type: [found: " + eo.getApiType() + "] [expected: " + API_TYPE + "]");
        eo.setValue(KEY_LISTENPORT, value);
    }

    public static void setIfUnsetListenPort(final EO eo, java.math.BigDecimal value) {
        if (!assertType(eo))
            throw new IllegalArgumentException("Mismatched EO type: [found: " + eo.getApiType() + "] [expected: " + API_TYPE + "]");
        eo.setValueIfUnset(KEY_LISTENPORT, value);
    }



}