com.connectifex.polymer.mdl.shared.generated.types.ExpectedGroupValue 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;
// Generated from: org.dmd.util.codegen.ImportManager.getFormattedImports(ImportManager.java:82)
// Called from: org.dmd.dms.util.NewComplexTypeFormatter.dumpComplexType(NewComplexTypeFormatter.java:148)
import java.io.Serializable; // To prevent serialization warnings - (NewComplexTypeFormatter.java:113)
import java.util.ArrayList; // To store ParsedNameValuePairs - (NewComplexTypeFormatter.java:120)
import org.dmd.dmc.DmcAttributeInfo; // For fake DmcAttributeInfo - (NewComplexTypeFormatter.java:118)
import org.dmd.dmc.DmcInputStreamIF; // Standard serialization techniques - (NewComplexTypeFormatter.java:114)
import org.dmd.dmc.DmcOutputStreamIF; // Standard serialization techniques - (NewComplexTypeFormatter.java:115)
import org.dmd.dmc.DmcValueException; // Standard value exception - (NewComplexTypeFormatter.java:143)
import org.dmd.dmc.util.ComplexTypeSplitter; // For parsing initial input - (NewComplexTypeFormatter.java:119)
import org.dmd.dmc.util.JSONUtil; // To perform escaping of things in JSON - (NewComplexTypeFormatter.java:122)
import org.dmd.dmc.util.ParsedNameValuePair; // To store values parsed from initial input - (NewComplexTypeFormatter.java:121)
import org.dmd.dms.generated.enums.DataTypeEnum; // For fake DmcAttributeInfo - (NewComplexTypeFormatter.java:116)
import org.dmd.dms.generated.enums.ValueTypeEnum; // For fake DmcAttributeInfo - (NewComplexTypeFormatter.java:117)
import org.dmd.dms.generated.types.DmcTypeStringSTATIC; // Standard type - (NewComplexTypeFormatter.java:1204)
@SuppressWarnings("serial")
/**
* The ExpectedGroupValue class.
* This code was auto-generated and shouldn't be alterred manually.
*
* Generated from: org.dmd.dms.util.NewComplexTypeFormatter.dumpComplexType(NewComplexTypeFormatter.java:155)
*/
public class ExpectedGroupValue implements Serializable {
final static int requiredParts = 2;
// The name of the pattern group
String groupNameV;
final static DmcAttributeInfo groupNameAI = new DmcAttributeInfo("groupName",0,"String",ValueTypeEnum.SINGLE,DataTypeEnum.UNKNOWN, 0, false);
// The value that the group should have.
String valueV;
final static DmcAttributeInfo valueAI = new DmcAttributeInfo("value",0,"String",ValueTypeEnum.SINGLE,DataTypeEnum.UNKNOWN, 0, false);
// An optional note
String noteV;
final static DmcAttributeInfo noteAI = new DmcAttributeInfo("note",0,"String",ValueTypeEnum.SINGLE,DataTypeEnum.UNKNOWN, 0, false);
/**
* Default constructor.
*/
public ExpectedGroupValue(){
}
/**
* Copy constructor.
*/
public ExpectedGroupValue(ExpectedGroupValue original){
// Generated from: org.dmd.dms.util.NewComplexTypeFormatter.getCopyConstructorAssignments(NewComplexTypeFormatter.java:1141)
groupNameV = original.groupNameV;
valueV = original.valueV;
noteV = original.noteV;
}
/**
* All fields constructor.
* Generated from: org.dmd.dms.util.NewComplexTypeFormatter.dumpComplexType(NewComplexTypeFormatter.java:186)
*/
public ExpectedGroupValue(String groupName_, String value_, String note_) throws DmcValueException {
groupNameV = DmcTypeStringSTATIC.instance.typeCheck(groupName_);
valueV = DmcTypeStringSTATIC.instance.typeCheck(value_);
if (note_ != null)
noteV = DmcTypeStringSTATIC.instance.typeCheck(note_);
}
/**
* String based constructor.
* Generated from: org.dmd.dms.util.NewComplexTypeFormatter.dumpComplexType(NewComplexTypeFormatter.java:269)
*/
public ExpectedGroupValue(String initialInput) throws DmcValueException {
initialize(initialInput);
}
/**
* Initialize content based on string form.
* Generated from: org.dmd.dms.util.NewComplexTypeFormatter.dumpComplexType(NewComplexTypeFormatter.java:277)
*/
void initialize(String initialInput) throws DmcValueException {
ArrayList nvp = ComplexTypeSplitter.parse(initialInput);
if (nvp.size() < requiredParts)
throw(new DmcValueException("Missing required values for complex type: ExpectedGroupValue\nValue: " + initialInput));
groupNameV = DmcTypeStringSTATIC.instance.typeCheck(nvp.get(0).getValue());
valueV = DmcTypeStringSTATIC.instance.typeCheck(nvp.get(1).getValue());
if (nvp.size() > requiredParts){
for(int i=2; i