org.apache.airavata.model.WorkflowModel Maven / Gradle / Ivy
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.
*/
/**
* Autogenerated by Thrift Compiler (0.9.3)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.airavata.model;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-07-13")
public class WorkflowModel implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("WorkflowModel");
private static final org.apache.thrift.protocol.TField TEMPLATE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("templateId", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField GRAPH_FIELD_DESC = new org.apache.thrift.protocol.TField("graph", org.apache.thrift.protocol.TType.STRING, (short)3);
private static final org.apache.thrift.protocol.TField GATEWAY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayId", org.apache.thrift.protocol.TType.STRING, (short)4);
private static final org.apache.thrift.protocol.TField CREATED_USER_FIELD_DESC = new org.apache.thrift.protocol.TField("createdUser", org.apache.thrift.protocol.TType.STRING, (short)5);
private static final org.apache.thrift.protocol.TField IMAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("image", org.apache.thrift.protocol.TType.STRING, (short)6);
private static final org.apache.thrift.protocol.TField WORKFLOW_INPUTS_FIELD_DESC = new org.apache.thrift.protocol.TField("workflowInputs", org.apache.thrift.protocol.TType.LIST, (short)7);
private static final org.apache.thrift.protocol.TField WORKFLOW_OUTPUTS_FIELD_DESC = new org.apache.thrift.protocol.TField("workflowOutputs", org.apache.thrift.protocol.TType.LIST, (short)8);
private static final org.apache.thrift.protocol.TField CREATION_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("creationTime", org.apache.thrift.protocol.TType.I64, (short)9);
private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new WorkflowModelStandardSchemeFactory());
schemes.put(TupleScheme.class, new WorkflowModelTupleSchemeFactory());
}
private String templateId; // required
private String name; // required
private String graph; // required
private String gatewayId; // required
private String createdUser; // required
private ByteBuffer image; // optional
private List workflowInputs; // optional
private List workflowOutputs; // optional
private long creationTime; // optional
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TEMPLATE_ID((short)1, "templateId"),
NAME((short)2, "name"),
GRAPH((short)3, "graph"),
GATEWAY_ID((short)4, "gatewayId"),
CREATED_USER((short)5, "createdUser"),
IMAGE((short)6, "image"),
WORKFLOW_INPUTS((short)7, "workflowInputs"),
WORKFLOW_OUTPUTS((short)8, "workflowOutputs"),
CREATION_TIME((short)9, "creationTime");
private static final Map byName = new HashMap();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // TEMPLATE_ID
return TEMPLATE_ID;
case 2: // NAME
return NAME;
case 3: // GRAPH
return GRAPH;
case 4: // GATEWAY_ID
return GATEWAY_ID;
case 5: // CREATED_USER
return CREATED_USER;
case 6: // IMAGE
return IMAGE;
case 7: // WORKFLOW_INPUTS
return WORKFLOW_INPUTS;
case 8: // WORKFLOW_OUTPUTS
return WORKFLOW_OUTPUTS;
case 9: // CREATION_TIME
return CREATION_TIME;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __CREATIONTIME_ISSET_ID = 0;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.IMAGE,_Fields.WORKFLOW_INPUTS,_Fields.WORKFLOW_OUTPUTS,_Fields.CREATION_TIME};
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.TEMPLATE_ID, new org.apache.thrift.meta_data.FieldMetaData("templateId", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.GRAPH, new org.apache.thrift.meta_data.FieldMetaData("graph", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.GATEWAY_ID, new org.apache.thrift.meta_data.FieldMetaData("gatewayId", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.CREATED_USER, new org.apache.thrift.meta_data.FieldMetaData("createdUser", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.IMAGE, new org.apache.thrift.meta_data.FieldMetaData("image", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
tmpMap.put(_Fields.WORKFLOW_INPUTS, new org.apache.thrift.meta_data.FieldMetaData("workflowInputs", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.model.application.io.InputDataObjectType.class))));
tmpMap.put(_Fields.WORKFLOW_OUTPUTS, new org.apache.thrift.meta_data.FieldMetaData("workflowOutputs", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.model.application.io.OutputDataObjectType.class))));
tmpMap.put(_Fields.CREATION_TIME, new org.apache.thrift.meta_data.FieldMetaData("creationTime", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(WorkflowModel.class, metaDataMap);
}
public WorkflowModel() {
this.templateId = "DO_NOT_SET_AT_CLIENTS";
}
public WorkflowModel(
String templateId,
String name,
String graph,
String gatewayId,
String createdUser)
{
this();
this.templateId = templateId;
this.name = name;
this.graph = graph;
this.gatewayId = gatewayId;
this.createdUser = createdUser;
}
/**
* Performs a deep copy on other.
*/
public WorkflowModel(WorkflowModel other) {
__isset_bitfield = other.__isset_bitfield;
if (other.isSetTemplateId()) {
this.templateId = other.templateId;
}
if (other.isSetName()) {
this.name = other.name;
}
if (other.isSetGraph()) {
this.graph = other.graph;
}
if (other.isSetGatewayId()) {
this.gatewayId = other.gatewayId;
}
if (other.isSetCreatedUser()) {
this.createdUser = other.createdUser;
}
if (other.isSetImage()) {
this.image = org.apache.thrift.TBaseHelper.copyBinary(other.image);
}
if (other.isSetWorkflowInputs()) {
List __this__workflowInputs = new ArrayList(other.workflowInputs.size());
for (org.apache.airavata.model.application.io.InputDataObjectType other_element : other.workflowInputs) {
__this__workflowInputs.add(new org.apache.airavata.model.application.io.InputDataObjectType(other_element));
}
this.workflowInputs = __this__workflowInputs;
}
if (other.isSetWorkflowOutputs()) {
List __this__workflowOutputs = new ArrayList(other.workflowOutputs.size());
for (org.apache.airavata.model.application.io.OutputDataObjectType other_element : other.workflowOutputs) {
__this__workflowOutputs.add(new org.apache.airavata.model.application.io.OutputDataObjectType(other_element));
}
this.workflowOutputs = __this__workflowOutputs;
}
this.creationTime = other.creationTime;
}
public WorkflowModel deepCopy() {
return new WorkflowModel(this);
}
@Override
public void clear() {
this.templateId = "DO_NOT_SET_AT_CLIENTS";
this.name = null;
this.graph = null;
this.gatewayId = null;
this.createdUser = null;
this.image = null;
this.workflowInputs = null;
this.workflowOutputs = null;
setCreationTimeIsSet(false);
this.creationTime = 0;
}
public String getTemplateId() {
return this.templateId;
}
public void setTemplateId(String templateId) {
this.templateId = templateId;
}
public void unsetTemplateId() {
this.templateId = null;
}
/** Returns true if field templateId is set (has been assigned a value) and false otherwise */
public boolean isSetTemplateId() {
return this.templateId != null;
}
public void setTemplateIdIsSet(boolean value) {
if (!value) {
this.templateId = null;
}
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public void unsetName() {
this.name = null;
}
/** Returns true if field name is set (has been assigned a value) and false otherwise */
public boolean isSetName() {
return this.name != null;
}
public void setNameIsSet(boolean value) {
if (!value) {
this.name = null;
}
}
public String getGraph() {
return this.graph;
}
public void setGraph(String graph) {
this.graph = graph;
}
public void unsetGraph() {
this.graph = null;
}
/** Returns true if field graph is set (has been assigned a value) and false otherwise */
public boolean isSetGraph() {
return this.graph != null;
}
public void setGraphIsSet(boolean value) {
if (!value) {
this.graph = null;
}
}
public String getGatewayId() {
return this.gatewayId;
}
public void setGatewayId(String gatewayId) {
this.gatewayId = gatewayId;
}
public void unsetGatewayId() {
this.gatewayId = null;
}
/** Returns true if field gatewayId is set (has been assigned a value) and false otherwise */
public boolean isSetGatewayId() {
return this.gatewayId != null;
}
public void setGatewayIdIsSet(boolean value) {
if (!value) {
this.gatewayId = null;
}
}
public String getCreatedUser() {
return this.createdUser;
}
public void setCreatedUser(String createdUser) {
this.createdUser = createdUser;
}
public void unsetCreatedUser() {
this.createdUser = null;
}
/** Returns true if field createdUser is set (has been assigned a value) and false otherwise */
public boolean isSetCreatedUser() {
return this.createdUser != null;
}
public void setCreatedUserIsSet(boolean value) {
if (!value) {
this.createdUser = null;
}
}
public byte[] getImage() {
setImage(org.apache.thrift.TBaseHelper.rightSize(image));
return image == null ? null : image.array();
}
public ByteBuffer bufferForImage() {
return org.apache.thrift.TBaseHelper.copyBinary(image);
}
public void setImage(byte[] image) {
this.image = image == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(image, image.length));
}
public void setImage(ByteBuffer image) {
this.image = org.apache.thrift.TBaseHelper.copyBinary(image);
}
public void unsetImage() {
this.image = null;
}
/** Returns true if field image is set (has been assigned a value) and false otherwise */
public boolean isSetImage() {
return this.image != null;
}
public void setImageIsSet(boolean value) {
if (!value) {
this.image = null;
}
}
public int getWorkflowInputsSize() {
return (this.workflowInputs == null) ? 0 : this.workflowInputs.size();
}
public java.util.Iterator getWorkflowInputsIterator() {
return (this.workflowInputs == null) ? null : this.workflowInputs.iterator();
}
public void addToWorkflowInputs(org.apache.airavata.model.application.io.InputDataObjectType elem) {
if (this.workflowInputs == null) {
this.workflowInputs = new ArrayList();
}
this.workflowInputs.add(elem);
}
public List getWorkflowInputs() {
return this.workflowInputs;
}
public void setWorkflowInputs(List workflowInputs) {
this.workflowInputs = workflowInputs;
}
public void unsetWorkflowInputs() {
this.workflowInputs = null;
}
/** Returns true if field workflowInputs is set (has been assigned a value) and false otherwise */
public boolean isSetWorkflowInputs() {
return this.workflowInputs != null;
}
public void setWorkflowInputsIsSet(boolean value) {
if (!value) {
this.workflowInputs = null;
}
}
public int getWorkflowOutputsSize() {
return (this.workflowOutputs == null) ? 0 : this.workflowOutputs.size();
}
public java.util.Iterator getWorkflowOutputsIterator() {
return (this.workflowOutputs == null) ? null : this.workflowOutputs.iterator();
}
public void addToWorkflowOutputs(org.apache.airavata.model.application.io.OutputDataObjectType elem) {
if (this.workflowOutputs == null) {
this.workflowOutputs = new ArrayList();
}
this.workflowOutputs.add(elem);
}
public List getWorkflowOutputs() {
return this.workflowOutputs;
}
public void setWorkflowOutputs(List workflowOutputs) {
this.workflowOutputs = workflowOutputs;
}
public void unsetWorkflowOutputs() {
this.workflowOutputs = null;
}
/** Returns true if field workflowOutputs is set (has been assigned a value) and false otherwise */
public boolean isSetWorkflowOutputs() {
return this.workflowOutputs != null;
}
public void setWorkflowOutputsIsSet(boolean value) {
if (!value) {
this.workflowOutputs = null;
}
}
public long getCreationTime() {
return this.creationTime;
}
public void setCreationTime(long creationTime) {
this.creationTime = creationTime;
setCreationTimeIsSet(true);
}
public void unsetCreationTime() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CREATIONTIME_ISSET_ID);
}
/** Returns true if field creationTime is set (has been assigned a value) and false otherwise */
public boolean isSetCreationTime() {
return EncodingUtils.testBit(__isset_bitfield, __CREATIONTIME_ISSET_ID);
}
public void setCreationTimeIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CREATIONTIME_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case TEMPLATE_ID:
if (value == null) {
unsetTemplateId();
} else {
setTemplateId((String)value);
}
break;
case NAME:
if (value == null) {
unsetName();
} else {
setName((String)value);
}
break;
case GRAPH:
if (value == null) {
unsetGraph();
} else {
setGraph((String)value);
}
break;
case GATEWAY_ID:
if (value == null) {
unsetGatewayId();
} else {
setGatewayId((String)value);
}
break;
case CREATED_USER:
if (value == null) {
unsetCreatedUser();
} else {
setCreatedUser((String)value);
}
break;
case IMAGE:
if (value == null) {
unsetImage();
} else {
setImage((ByteBuffer)value);
}
break;
case WORKFLOW_INPUTS:
if (value == null) {
unsetWorkflowInputs();
} else {
setWorkflowInputs((List)value);
}
break;
case WORKFLOW_OUTPUTS:
if (value == null) {
unsetWorkflowOutputs();
} else {
setWorkflowOutputs((List)value);
}
break;
case CREATION_TIME:
if (value == null) {
unsetCreationTime();
} else {
setCreationTime((Long)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case TEMPLATE_ID:
return getTemplateId();
case NAME:
return getName();
case GRAPH:
return getGraph();
case GATEWAY_ID:
return getGatewayId();
case CREATED_USER:
return getCreatedUser();
case IMAGE:
return getImage();
case WORKFLOW_INPUTS:
return getWorkflowInputs();
case WORKFLOW_OUTPUTS:
return getWorkflowOutputs();
case CREATION_TIME:
return getCreationTime();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case TEMPLATE_ID:
return isSetTemplateId();
case NAME:
return isSetName();
case GRAPH:
return isSetGraph();
case GATEWAY_ID:
return isSetGatewayId();
case CREATED_USER:
return isSetCreatedUser();
case IMAGE:
return isSetImage();
case WORKFLOW_INPUTS:
return isSetWorkflowInputs();
case WORKFLOW_OUTPUTS:
return isSetWorkflowOutputs();
case CREATION_TIME:
return isSetCreationTime();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof WorkflowModel)
return this.equals((WorkflowModel)that);
return false;
}
public boolean equals(WorkflowModel that) {
if (that == null)
return false;
boolean this_present_templateId = true && this.isSetTemplateId();
boolean that_present_templateId = true && that.isSetTemplateId();
if (this_present_templateId || that_present_templateId) {
if (!(this_present_templateId && that_present_templateId))
return false;
if (!this.templateId.equals(that.templateId))
return false;
}
boolean this_present_name = true && this.isSetName();
boolean that_present_name = true && that.isSetName();
if (this_present_name || that_present_name) {
if (!(this_present_name && that_present_name))
return false;
if (!this.name.equals(that.name))
return false;
}
boolean this_present_graph = true && this.isSetGraph();
boolean that_present_graph = true && that.isSetGraph();
if (this_present_graph || that_present_graph) {
if (!(this_present_graph && that_present_graph))
return false;
if (!this.graph.equals(that.graph))
return false;
}
boolean this_present_gatewayId = true && this.isSetGatewayId();
boolean that_present_gatewayId = true && that.isSetGatewayId();
if (this_present_gatewayId || that_present_gatewayId) {
if (!(this_present_gatewayId && that_present_gatewayId))
return false;
if (!this.gatewayId.equals(that.gatewayId))
return false;
}
boolean this_present_createdUser = true && this.isSetCreatedUser();
boolean that_present_createdUser = true && that.isSetCreatedUser();
if (this_present_createdUser || that_present_createdUser) {
if (!(this_present_createdUser && that_present_createdUser))
return false;
if (!this.createdUser.equals(that.createdUser))
return false;
}
boolean this_present_image = true && this.isSetImage();
boolean that_present_image = true && that.isSetImage();
if (this_present_image || that_present_image) {
if (!(this_present_image && that_present_image))
return false;
if (!this.image.equals(that.image))
return false;
}
boolean this_present_workflowInputs = true && this.isSetWorkflowInputs();
boolean that_present_workflowInputs = true && that.isSetWorkflowInputs();
if (this_present_workflowInputs || that_present_workflowInputs) {
if (!(this_present_workflowInputs && that_present_workflowInputs))
return false;
if (!this.workflowInputs.equals(that.workflowInputs))
return false;
}
boolean this_present_workflowOutputs = true && this.isSetWorkflowOutputs();
boolean that_present_workflowOutputs = true && that.isSetWorkflowOutputs();
if (this_present_workflowOutputs || that_present_workflowOutputs) {
if (!(this_present_workflowOutputs && that_present_workflowOutputs))
return false;
if (!this.workflowOutputs.equals(that.workflowOutputs))
return false;
}
boolean this_present_creationTime = true && this.isSetCreationTime();
boolean that_present_creationTime = true && that.isSetCreationTime();
if (this_present_creationTime || that_present_creationTime) {
if (!(this_present_creationTime && that_present_creationTime))
return false;
if (this.creationTime != that.creationTime)
return false;
}
return true;
}
@Override
public int hashCode() {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy