com.connectifex.polymer.mdl.shared.generated.types.PlasticMappingREF 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.DmcAttribute;
import org.dmd.dmc.DmcAttributeInfo;
import org.dmd.dmc.DmcObjectName;
import org.dmd.dmc.DmcValueException;
import org.dmd.dmc.DmcOutputStreamIF;
import org.dmd.dmc.DmcInputStreamIF;
import org.dmd.dmc.DmcNamedObjectNontransportableREF; // base import
import com.connectifex.polymer.mdl.shared.generated.dmo.PlasticMappingDMO; // primitive type
import org.dmd.dmc.types.DefinitionName;
import org.dmd.dms.generated.types.DmcTypeDefinitionNameSV;
import org.dmd.dms.generated.enums.ValueTypeEnum;
import org.dmd.dms.generated.enums.DataTypeEnum;
/**
* 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.dumpNamedREF(DmoTypeFormatter.java:420)
*/
@SuppressWarnings("serial")
public class PlasticMappingREF extends DmcNamedObjectNontransportableREF {
public final static DmcAttributeInfo __name = new DmcAttributeInfo("name",2,"DefinitionName",ValueTypeEnum.SINGLE,DataTypeEnum.PERSISTENT);
DmcTypeDefinitionNameSV myName;
// Generated from: org.dmd.dms.util.DmoTypeFormatter.dumpNamedREF(DmoTypeFormatter.java:437)
public PlasticMappingREF(){
}
// Generated from: org.dmd.dms.util.DmoTypeFormatter.dumpNamedREF(DmoTypeFormatter.java:441)
public PlasticMappingREF(PlasticMappingDMO o){
object = o;
myName = (DmcTypeDefinitionNameSV)o.getObjectNameAttribute();
}
// Generated from: org.dmd.dms.util.DmoTypeFormatter.dumpNamedREF(DmoTypeFormatter.java:447)
public PlasticMappingREF(DefinitionName n) throws DmcValueException {
object = null;
myName = new DmcTypeDefinitionNameSV(__name);
myName.set(n);
}
// Generated from: org.dmd.dms.util.DmoTypeFormatter.dumpNamedREF(DmoTypeFormatter.java:454)
public PlasticMappingREF(String n) throws DmcValueException {
object = null;
myName = new DmcTypeDefinitionNameSV(__name);
myName.set(n);
}
// Generated from: org.dmd.dms.util.DmoTypeFormatter.dumpNamedREF(DmoTypeFormatter.java:461)
public PlasticMappingREF(PlasticMappingREF original){
myName = original.myName;
object = original.object;
}
// Generated from: org.dmd.dms.util.DmoTypeFormatter.dumpNamedREF(DmoTypeFormatter.java:467)
public void setObject(PlasticMappingDMO o){
object = o;
if (object != null)
myName = (DmcTypeDefinitionNameSV)o.getObjectNameAttribute();
}
/**
* Clones this reference.
*/
// Generated from: org.dmd.dms.util.DmoTypeFormatter.dumpNamedREF(DmoTypeFormatter.java:477)
public PlasticMappingREF cloneMe(){
PlasticMappingREF rc = new PlasticMappingREF();
rc.myName = myName;
rc.object = object;
return(rc);
}
@Override
public void setName(DmcObjectName n) throws DmcValueException {
if (myName == null)
myName = new DmcTypeDefinitionNameSV(__name);
myName.set(n);
}
public DmcObjectName getObjectName(){
if (myName == null)
throw(new IllegalStateException("You've tried to access the name of an object but the name attribute hasn't been set."));
return(myName.getSV());
}
public DefinitionName getName(){
if (myName == null)
throw(new IllegalStateException("You've tried to access the name of an object but the name attribute hasn't been set."));
return(myName.getSV());
}
public DmcAttribute getObjectNameAttribute(){
if (myName == null)
throw(new IllegalStateException("You've tried to access the name of an object but the name attribute hasn't been set."));
return(myName);
}
public void serializeIt(DmcOutputStreamIF dos) throws Exception {
myName.serializeIt(dos);
}
public void deserializeIt(DmcInputStreamIF dis) throws Exception {
myName = (DmcTypeDefinitionNameSV) dis.getAttributeInstance();
myName.deserializeIt(dis);
}
}