com.connectifex.polymer.mdl.shared.generated.types.DmcTypePlasticMappingREF Maven / Gradle / Ivy
// Copyright 2020 connectifex
//
// 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 com.connectifex.polymer.mdl.shared.generated.types;
import org.dmd.dmc.DmcAttributeInfo;
import org.dmd.dmc.DmcValueException;
import org.dmd.dmc.DmcOutputStreamIF;
import org.dmd.dmc.DmcInputStreamIF;
import org.dmd.dmc.types.DmcTypeNamedObjectREF;
import org.dmd.dmc.types.DefinitionName;
import com.connectifex.polymer.mdl.shared.generated.types.PlasticMappingREF;
import com.connectifex.polymer.mdl.shared.generated.dmo.PlasticMappingDMO;
/**
* This is the generated DmcAttribute derivative for values of type PlasticMapping
*
* Generated from the mdl schema at version unknown
*
* This code was auto-generated by the dmogenerator utility and shouldn't be alterred manually!
* Generated from: org.dmd.dms.util.DmoTypeFormatter.dumpNamedREFHelperType(DmoTypeFormatter.java:589)
*/
@SuppressWarnings("serial")
abstract public class DmcTypePlasticMappingREF extends DmcTypeNamedObjectREF {
public DmcTypePlasticMappingREF(){
}
public DmcTypePlasticMappingREF(DmcAttributeInfo ai){
super(ai);
}
@Override
protected PlasticMappingREF getNewHelper(){
return(new PlasticMappingREF());
}
@Override
protected DefinitionName getNewName(){
return(new DefinitionName());
}
@Override
protected String getDMOClassName(){
return( PlasticMappingDMO.class.getName());
}
@Override
protected boolean isDMO(Object value){
if (value instanceof PlasticMappingDMO)
return(true);
return(false);
}
@Override
protected PlasticMappingREF typeCheck(Object value) throws DmcValueException {
PlasticMappingREF rc = null;
if (value instanceof PlasticMappingREF)
rc = (PlasticMappingREF)value;
else if (value instanceof PlasticMappingDMO)
rc = new PlasticMappingREF((PlasticMappingDMO)value);
else if (value instanceof DefinitionName)
rc = new PlasticMappingREF((DefinitionName)value);
else if (value instanceof String)
rc = new PlasticMappingREF((String)value);
else
throw(new DmcValueException("Object of class: " + value.getClass().getName() + " passed where object compatible with PlasticMappingREF, PlasticMappingDMO or String expected."));
return(rc);
}
@Override
public void serializeValue(DmcOutputStreamIF dos, PlasticMappingREF value) throws Exception {
value.serializeIt(dos);
}
@Override
public PlasticMappingREF deserializeValue(DmcInputStreamIF dis) throws Exception {
PlasticMappingREF rc = new PlasticMappingREF();
rc.deserializeIt(dis);
return(rc);
}
@Override
public PlasticMappingREF cloneValue(PlasticMappingREF value){
return(new PlasticMappingREF(value));
}
}