text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta name="robots" content="all,follow">
  <meta name="googlebot" content="index,follow,snippet,archive">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <title>Template Variables</title>

  <meta name="author" content="" />
  <meta name="keywords" content="">

  <meta name="generator" content="Hugo 0.19" />

  <link href='//fonts.googleapis.com/css?family=Roboto:400,100,100italic,300,300italic,500,700,800' rel='stylesheet' type='text/css'>

  <link href="https://dischord01.github.io/css/animate.css" rel="stylesheet">

  <link href="https://dischord01.github.io/bower_components/patternfly/dist/css/patternfly.min.css" rel="stylesheet" media="screen, print">
  <link href="https://dischord01.github.io/bower_components/patternfly/dist/css/patternfly-additions.min.css" rel="stylesheet" media="screen, print">

  <link href="https://dischord01.github.io/css/redhatgov.css" rel="stylesheet">

  <link href="https://dischord01.github.io/css/highlight/github.css" rel="stylesheet">

  <link href="https://dischord01.github.io/css/perfect-scrollbar.min.css" rel="stylesheet">

  <link href="https://dischord01.github.io/css/featherlight.min.css" rel="stylesheet">

  <link rel="shortcut icon" href="https://dischord01.github.io/img/favicon.ico" type="image/x-icon" />
  <link rel="apple-touch-icon" href="https://dischord01.github.io/img/apple-touch-icon.png" />

  <link rel="alternate" href="https://dischord01.github.io/index.xml" type="application/rss+xml" title="RedHatGov">

  <meta property="og:title" content="Template Variables" />
  <meta property="og:type" content="website" />
  <meta property="og:url" content="/workshops/toc//" />
  <meta property="og:image" content="img/redhat.png" />

    Template Variables - go to homepage

         Cloud

         Platform

         Workshops

         Quickstarts

Template Variables

July 1, 2013

Template Variables

Hugo makes a set of values available to the templates. Go templates are context based. The following
are available in the context for the templates.

Page Variables

The following is a list of most of the accessible variables which can be
defined for a piece of content. Many of these will be defined in the front
matter, content or derived from file location.

See also: Scratch for page-scoped writable variables.

.Content The content itself, defined below the front matter.

.Data The data specific to this type of page.

.Date The date the page is associated with.

.Description The description for the page.

.Draft A boolean, true if the content is marked as a draft in the front matter.

.ExpiryDate The date where the content is scheduled to expire on.

.FuzzyWordCount The approximate number of words in the content.

.Hugo See Hugo Variables below.

.IsHome True if this is the home page.

.IsNode Always false for regular content pages.

.IsPage Always true for regular content pages.

.IsTranslated Whether there are any translations to display.

.Keywords The meta keywords for this content.

.Kind What kind of page is this: is one of page, home, section, taxonomy or taxonomyTerm. There are also RSS, sitemap, robotsTXT and 404, but these will only available during rendering of that kind of page, and not available in any of the Pages collections.

.Lang Language taken from the language extension notation.

.Language A language object that points to this the language’s definition in the site config.

.Lastmod The date the content was last modified.

.LinkTitle Access when creating links to this content. Will use linktitle if set in front matter, else title.

.Next Pointer to the following content (based on pub date).

.NextInSection Pointer to the following content within the same section (based on pub date)

.Pages a collection of associated pages. This will be nil for regular content pages. This is an alias for .Data.Pages.

.Permalink The Permanent link for this page.

.Prev Pointer to the previous content (based on pub date).

.PrevInSection Pointer to the previous content within the same section (based on pub date). For example, {{if .PrevInSection}}{{.PrevInSection.Permalink}}{{end}}.

.PublishDate The date the content is published on.

.RSSLink Link to the taxonomies’ RSS link.

.RawContent Raw Markdown content without the metadata header. Useful with remarkjs.com

.ReadingTime The estimated time it takes to read the content in minutes.

.Ref Returns the permalink for a given reference.  Example: .Ref "sample.md". See cross-references. Does not handle in-page fragments correctly.

.RelPermalink The Relative permanent link for this page.

.RelRef Returns the relative permalink for a given reference.  Example: RelRef "sample.md". See cross-references. Does not handle in-page fragments.

.Section The section this content belongs to.

.Site See Site Variables below.

.Summary A generated summary of the content for easily showing a snippet in a summary view. Note that the breakpoint can be set manually by inserting <!--more--> at the appropriate place in the content page.  See Summaries for more details.

.TableOfContents The rendered table of contents for this content.

.Title  The title for this page.

.Translations A list of translated versions of the current page. See Multilingual for more info.

.Truncated A boolean, true if the .Summary is truncated.  Useful for showing a “Read more…” link only if necessary.  See Summaries for more details.

.Type The content type (e.g. post).

.URL The relative URL for this page. Note that if URL is set directly in frontmatter, that URL is returned as-is.

.UniqueID The MD5-checksum of the content file’s path

.Weight Assigned weight (in the front matter) to this content, used in sorting.

.WordCount The number of words in the content.

Page Params

Any other value defined in the front matter, including taxonomies, will be made available under .Params.
For example, the tags and categories taxonomies are accessed with:

.Params.tags

.Params.categories

All Params are only accessible using all lowercase characters.

This is particularly useful for the introduction of user defined fields in content files. For example, a Hugo website on book reviews could have in the front matter of /content/review/book01.md

---
...
affiliatelink: "http://www.my-book-link.here"
recommendedby: "my Mother"
---

Which would then be accessible to a template at /themes/yourtheme/layouts/review/single.html through .Params.affiliatelink and .Params.recommendedby, respectively. Two common situations where these could be introduced are as a value of a certain attribute (like href="" below) or by itself to be displayed. Sample syntaxes include:

<h3><a href={{ printf "%s" $.Params.affiliatelink }}>Buy this book</a></h3>
<p>It was recommended by {{ .Params.recommendedby }}.</p>

which would render

<h3><a href="http://www.my-book-link.here">Buy this book</a></h3>
<p>It was recommended by my Mother.</p>

See also: Archetypes for consistency of Params across pieces of content.

Param method

In Hugo you can declare params both for the site and the individual page. A
common use case is to have a general value for the site and a more specific
value for some of the pages (i.e. a header image):

{{ $.Param "header_image" }}

The .Param method provides a way to resolve a single value whether it’s
in a page parameter or a site parameter.

When frontmatter contains nested fields, like:

---
author:
  given_name: John
  family_name: Feminella
  display_name: John Feminella
---

then .Param can access them by concatenating the field names together with a
dot:

{{ $.Param "author.display_name" }}

If your frontmatter contains a top-level key that is ambiguous with a nested
key, as in the following case,

---
favorites.flavor: vanilla
favorites:
  flavor: chocolate
---

then the top-level key will be preferred. In the previous example, this

{{ $.Param "favorites.flavor" }}

will print vanilla, not chocolate.

Taxonomy Terms Page Variables

Taxonomy Terms pages are of the type Page and have the following additional variables. These are available in layouts/_defaults/terms.html for example.

.Data.Singular The singular name of the taxonomy

.Data.Plural The plural name of the taxonomy

.Data.Pages the list of pages in this taxonomy

.Data.Terms The taxonomy itself

.Data.Terms.Alphabetical The Terms alphabetized

.Data.Terms.ByCount The Terms ordered by popularity

The last two can also be reversed: .Data.Terms.Alphabetical.Reverse, .Data.Terms.ByCount.Reverse.

Taxonomies elsewhere

The .Site.Taxonomies variable holds all taxonomies defines site-wide.  It is a map of the taxonomy name to a list of its values. For example: “tags” -> [“tag1”, “tag2”, “tag3”]. Each value, though, is not a string but rather a Taxonomy variable.

The Taxonomy variable

The Taxonomy variable, available as .Site.Taxonomies.tags for example, contains the list of tags (values) and, for each of those, their corresponding content pages.

Site Variables

Also available is .Site which has the following:

.Site.BaseURL The base URL for the site as defined in the site configuration file.

.Site.RSSLink The URL for the site RSS.

.Site.Taxonomies The taxonomies for the entire site.  Replaces the now-obsolete .Site.Indexes since v0.11. Also see section Taxonomies elsewhere.

.Site.Pages Array of all content ordered by Date, newest first.  Replaces the now-deprecated .Site.Recent starting v0.13. This array contains only the pages in the current language.

.Site.AllPages Array of all pages regardless of their translation.

.Site.Params A container holding the values from the params section of your site configuration file. For example, a TOML config file might look like this:

baseURL = "http://yoursite.example.com/"

[params]
  description = "Tesla's Awesome Hugo Site"
  author = "Nikola Tesla"

.Site.Sections Top level directories of the site.

.Site.Files All of the source files of the site.

.Site.Menus All of the menus in the site.

.Site.Title A string representing the title of the site.

.Site.Author A map of the authors as defined in the site configuration.

.Site.LanguageCode A string representing the language as defined in the site configuration. This is mostly used to populate the RSS feeds with the right language code.

.Site.DisqusShortname A string representing the shortname of the Disqus shortcode as defined in the site configuration.

.Site.GoogleAnalytics A string representing your tracking code for Google Analytics as defined in the site configuration.

.Site.Copyright A string representing the copyright of your web site as defined in the site configuration.

.Site.LastChange A string representing the date/time of the most recent change to your site, based on the date variable in the front matter of your content pages.

.Site.Permalinks A string to override the default permalink format. Defined in the site configuration.

.Site.BuildDrafts A boolean (Default: false) to indicate whether to build drafts. Defined in the site configuration.

.Site.Data  Custom data, see Data Files.

.Site.IsMultiLingual Whether there are more than one language in this site.
 See Multilingual for more info.

.Site.Language This indicates which language you are currently rendering the website for.  This is an object with the attributes set in your language definition in your site config.

.Site.Language.Lang The language code of the current locale, e.g. en.

.Site.Language.Weight The weight that defines the order in the .Site.Languages list.

.Site.Language.LanguageName The full language name, e.g. English.

.Site.LanguagePrefix This can be used to prefix  theURLs with whats needed to point to the correct language. It will even work when only one language defined. See also the functions absLangURL and relLangURL.

.Site.Languages An ordered list (ordered by defined weight) of languages.

.Site.RegularPages A shortcut to the regular page collection. Equivalent to where .Site.Pages "Kind" "page".

File Variables

The .File variable gives you additional information of a page.

Note: .File is only accessible on Pages that has a content page attached to it.

Available are the following attributes:

.File.Path The original relative path of the page, e.g. content/posts/foo.en.md

.File.LogicalName The name of the content file that represents a page, e.g. foo.en.md

.File.TranslationBaseName The filename without extension or optional language identifier, e.g. foo

.File.BaseFileName The filename without extension, e.g. foo.en

.File.Ext or .File.Extension The file extension of the content file, e.g. md

.File.Lang The language associated with the given file if Multilingual is enabled, e.g. en

.File.Dir Given the path content/posts/dir1/dir2/, the relative directory path of the content file will be returned, e.g. posts/dir1/dir2/

Hugo Variables

Also available is .Hugo which has the following:

.Hugo.Generator Meta tag for the version of Hugo that generated the site. Highly recommended to be included by default in all theme headers so we can start to track the usage and popularity of Hugo. Unlike other variables it outputs a complete HTML tag, e.g. <meta name="generator" content="Hugo 0.15" />

.Hugo.Version The current version of the Hugo binary you are using e.g. 0.13-DEV

.Hugo.CommitHash The git commit hash of the current Hugo binary e.g. 0e8bed9ccffba0df554728b46c5bbf6d78ae5247

.Hugo.BuildDate The compile date of the current Hugo binary formatted with RFC 3339 e.g. 2002-10-02T10:00:00-05:00

Table of Contents

Template Variables

Page Variables

Page Params

Param method

Taxonomy Terms Page Variables

Taxonomies elsewhere

The Taxonomy variable

Site Variables

File Variables

Hugo Variables

About us

Open source is not only behind many of the technology industry's most significant innovations, but it is also pervasive across the U.S. government. For more than a decade, Red Hat has been working closely with federal government customers to help them embrace open source technologies.

Contact

Red Hat Public Sector

8260 Greensboro Dr

# 300

McLean, VA 22102

        United States

            Contact Us.

Copyright  2013-07-01

redpajama_set_name: RedPajamaGithub


text:
package org.elassandra.index.search;

import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.search.BooleanClause.Occur;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.Query;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.index.IndexService;
import org.elasticsearch.index.IndexSettings;
import org.elasticsearch.index.shard.IndexSearcherWrapper;
import org.elasticsearch.index.shard.ShardId;
import org.elasticsearch.search.internal.ShardSearchRequest;

import java.io.IOException;

public class TokenRangesSearcherWrapper extends IndexSearcherWrapper {

    private static ThreadLocal<ShardSearchRequest> shardSearchRequest = new ThreadLocal<>();

    public static void current(ShardSearchRequest value) {
        shardSearchRequest.set(value);
    }

    public static void removeCurrent() {
        shardSearchRequest.remove();
    }

    public static ShardSearchRequest current() {
        return shardSearchRequest.get();
    }

    private final TokenRangesBitsetFilterCache filterCache;
    private final TokenRangesService tokenRangesService;

    public TokenRangesSearcherWrapper(TokenRangesBitsetFilterCache filterCache, TokenRangesService tokenRangeService) {
        this.filterCache = filterCache;
        this.tokenRangesService = tokenRangeService;
    }

    @Override
    public final DirectoryReader wrap(final DirectoryReader in) throws IOException {
        ShardSearchRequest request = current();
        if (request != null && !Boolean.FALSE.equals(request.tokenRangesBitsetCache()) && request.tokenRanges() != null) {
            Query tokenRangeQuery = tokenRangesService.getTokenRangesQuery(request.tokenRanges());
            if (tokenRangeQuery != null) {
                BooleanQuery.Builder qb = new BooleanQuery.Builder().add(tokenRangeQuery, Occur.FILTER);
                Query query = query(qb);
                return new TokenRangesDirectoryReader(in, query, this.filterCache);
            }
        }
        return in;
    }

    public Query query(BooleanQuery.Builder qb) {
        return qb.build();
    }

}


text:
  Champagney est
      une commune localisée dans le département de Haute-Saône en Franche-Comté. Elle comptait 3 552 habitants en 2008.

Le nombre d'habitations, à Champagney, se décomposait en 2011 en 258 appartements et 1 501 maisons soit
 un marché relativement équilibré.

La ville est équipée s'agissant de la formation de un collège.
Concernant les plus petits d'entre nous, la commune est pourvue pour le bien être de sa population de une maternelle et deux écoles primaires.
Champagney dispose des installations permettant une vie àgréable.
Lors d'un projet d'acheter un appartement ou une maison à Champagney, il est important évaluer la qualité des écoles de la communes

À Champagney, la valorisation moyenne à l'achat d'un appartement s'évalue à 942 € du m² en vente. la valorisation moyenne d'une maison à l'achat se situe à 1 331 € du m². À la location la valeur moyenne se situe à 7,74 € du m² par mois.

La commune propose de nombreux  équipements sportifs, elle propose entre autres un terrain de tennis, un centre d'équitation, deux terrains de sport et une boucle de randonnée.

À Champagney le salaire médian par mois par habitant est situé à approximativement 1 994 €  net. Ceci est au dessous de la moyenne du pays.

À coté de Champagney sont positionnées géographiquement les villes de
Ronchamp située à 3 km, 2 924 habitants,
Clairegoutte à 6 km, 433 habitants,
Recologne localisée à 5 km, 34 habitants,
Plancher-Bas à 4 km, 1 816 habitants,
Malbouhans localisée à 7 km, 378 habitants,
Étobon à 7 km, 281 habitants,
 entre autres. De plus, Champagney est située à seulement 15 km de Belfort.


text:
"""Represent the main entry point for the spline loc tool."""
# Copyright (c) 2018 Thomas Lehmann
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this
# software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
# to whom the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies
# or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
# INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# pylint: disable=no-self-use, cell-var-from-loop,unnecessary-lambda
import sys
import os
import platform
import logging
import multiprocessing
import re

import click
from yaml import safe_load

from spline.tools.logger import Logger
from spline.tools.adapter import Adapter
from spline.tools.query import Select
from spline.tools.table import pprint

class Application(object):
    """Spline loc application for counting loc, com and calculating ratio, failing by threshold."""

    def __init__(self, **options):
        """
        Initialize application with command line options.

        Args:
            options (ApplicationOptions): given command line options.
        """
        self.options = options
        self.logging_level = logging.DEBUG
        self.setup_logging()
        self.logger = Logger.get_logger(__name__)
        self.results = []

    def setup_logging(self):
        """Setup of application logging."""
        logging_format = "%(asctime)-15s - %(name)s - %(message)s"
        Logger.configure_default(logging_format, self.logging_level)

    def load_configuration(self):
        """Loading configuration."""
        filename = os.path.join(os.path.dirname(__file__), 'templates/spline-loc.yml.j2')
        with open(filename) as handle:
            return Adapter(safe_load(handle)).configuration

    @staticmethod
    def ignore_path(path):
        """
        Verify whether to ignore a path.

        Args:
            path (str): path to check.

        Returns:
            bool: True when to ignore given path.
        """
        ignore = False
        for name in ['.tox', 'dist', 'build', 'node_modules', 'htmlcov']:
            if path.find(name) >= 0:
                ignore = True
                break
        return ignore

    @staticmethod
    def walk_files_for(paths, supported_extensions):
        """
        Iterating files for given extensions.

        Args:
            supported_extensions (list): supported file extentsion for which to check loc and com.

        Returns:
            str: yield each full path and filename found.
        """
        for path in paths:
            for root, _, files in os.walk(path):
                if Application.ignore_path(root.replace(path, '')):
                    continue

                for filename in files:
                    extension = os.path.splitext(filename)[1]
                    if extension in supported_extensions:
                        yield path, os.path.join(root, filename), extension

    def analyse(self, path_and_filename, pattern):
        """
        Find out lines of code and lines of comments.

        Args:
            path_and_filename (str): path and filename to parse  for loc and com.
            pattern (str): regex to search for line commens and block comments

        Returns:
            int, int: loc and com for given file.
        """
        with open(path_and_filename) as handle:
            content = handle.read()
            loc = content.count('\n') + 1
            com = 0
            for match in re.findall(pattern, content, re.DOTALL):
                com += match.count('\n') + 1

            return max(0, loc - com), com

    def run(self):
        """Processing the pipeline."""
        self.logger.info("Running with Python %s", sys.version.replace("\n", ""))
        self.logger.info("Running on platform %s", platform.platform())
        self.logger.info("Current cpu count is %d", multiprocessing.cpu_count())

        configuration = self.load_configuration()
        paths = [os.path.abspath(path) for path in Adapter(self.options).path]
        supported_extension = [
            ext.strip() for entry in configuration for ext in Adapter(entry).extension.split()]

        for path, path_and_filename, extension in Application.walk_files_for(paths, supported_extension):
            entry = Select(*configuration) \
                .where(lambda entry: extension in Adapter(entry).extension.split()) \
                .transform(lambda entry: Adapter(entry)) \
                .build()[0]
            # parsing file with regex to get loc and com values
            # 100 lines of code (total) with 50 lines of comments means: loc=50, com=50
            # the ratio would be then: 1.0
            loc, com = self.analyse(path_and_filename, entry.regex)
            ratio = float(com) / float(loc) if loc > 0 and com < loc else 1.0

            self.results.append({
                'type': entry.type,
                'file': path_and_filename.replace(path + '/', ''),
                'loc': loc,
                'com': com,
                'ratio': "%.2f" % ratio
            })
        # for the table we are mainly interested in ratio below defined threshold
        # (except you want to see all of your code: --show-all)
        ppresults = Select(*self.results).where(
            lambda entry: float(Adapter(entry).ratio) < Adapter(self.options).threshold or
            Adapter(self.options).show_all).build()

        # print out results in table format
        pprint(ppresults, keys=['ratio', 'loc', 'com', 'file', 'type'])

        if Adapter(self.options).average:
            all_ratio = Select(*self.results).transform(lambda entry: float(Adapter(entry).ratio)).build()
            avg_ratio = float(sum(all_ratio)) / float(len(all_ratio)) if len(all_ratio) > 0 else 1.0
            self.logger.info('average ratio is %.2f for %d files', avg_ratio, len(all_ratio))
            return avg_ratio >= Adapter(self.options).threshold

        # providing results (mainly for unittesting)
        return len(Select(*self.results).where(
            lambda entry: float(Adapter(entry).ratio) < Adapter(self.options).threshold).build()) == 0

def main(**options):
    """Spline loc tool."""
    application = Application(**options)
    # fails application when your defined threshold is higher than your ratio of com/loc.
    if not application.run():
        sys.exit(1)
    return application

@click.command()
@click.option('--path', type=str, default=[os.getcwd()], multiple=True,
              help="Path where to parse files")
@click.option('-t', '--threshold', type=float, default=0.5,
              help="Expected Ratio between documentation and code (default: 0.5)")
@click.option('-s', '--show-all', is_flag=True, default=False,
              help="When enabled then showing statistic for all files")
@click.option('-a', '--average', is_flag=True, default=False,
              help='When set use the average com/loc of all files against threshold (default: false)')
def click_main(**options):
    """Spline loc tool - application entry point."""
    main(**options)

if __name__ == "__main__":
    click_main()


text:
from rdkit.Chem.rdMolChemicalFeatures import *
from rdkit.Chem.rdChemicalFeatures import *

def MCFF_GetFeaturesForMol(self,mol,includeOnly=""):
  res = []
  count = self.GetNumMolFeatures(mol,includeOnly=includeOnly)
  for i in range(count):
    res.append(self.GetMolFeature(mol,i,includeOnly=includeOnly))
  return tuple(res)
MolChemicalFeatureFactory.GetFeaturesForMol = MCFF_GetFeaturesForMol


text:
/**
 * Autogenerated by Thrift Compiler (0.9.1)
 *
 * 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 org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@SuppressWarnings("all") public class Workflow implements org.apache.thrift.TBase<Workflow, Workflow._Fields>, java.io.Serializable, Cloneable, Comparable<Workflow> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Workflow");

  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 IMAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("image", org.apache.thrift.protocol.TType.STRING, (short)4);
  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)5);
  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)6);

  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
  static {
    schemes.put(StandardScheme.class, new WorkflowStandardSchemeFactory());
    schemes.put(TupleScheme.class, new WorkflowTupleSchemeFactory());
  }

  private String templateId; // required
  private String name; // required
  private String graph; // optional
  private ByteBuffer image; // optional
  private List<org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType> workflowInputs; // optional
  private List<org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType> workflowOutputs; // optional

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    TEMPLATE_ID((short)1, "templateId"),
    NAME((short)2, "name"),
    GRAPH((short)3, "graph"),
    IMAGE((short)4, "image"),
    WORKFLOW_INPUTS((short)5, "workflowInputs"),
    WORKFLOW_OUTPUTS((short)6, "workflowOutputs");

    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

    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: // IMAGE
          return IMAGE;
        case 5: // WORKFLOW_INPUTS
          return WORKFLOW_INPUTS;
        case 6: // WORKFLOW_OUTPUTS
          return WORKFLOW_OUTPUTS;
        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 _Fields optionals[] = {_Fields.GRAPH,_Fields.IMAGE,_Fields.WORKFLOW_INPUTS,_Fields.WORKFLOW_OUTPUTS};
  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.OPTIONAL,
        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.appcatalog.appinterface.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.appcatalog.appinterface.OutputDataObjectType.class))));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Workflow.class, metaDataMap);
  }

  public Workflow() {
    this.templateId = "DO_NOT_SET_AT_CLIENTS";

  }

  public Workflow(
    String templateId,
    String name)
  {
    this();
    this.templateId = templateId;
    this.name = name;
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public Workflow(Workflow other) {
    if (other.isSetTemplateId()) {
      this.templateId = other.templateId;
    }
    if (other.isSetName()) {
      this.name = other.name;
    }
    if (other.isSetGraph()) {
      this.graph = other.graph;
    }
    if (other.isSetImage()) {
      this.image = org.apache.thrift.TBaseHelper.copyBinary(other.image);
;
    }
    if (other.isSetWorkflowInputs()) {
      List<org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType> __this__workflowInputs = new ArrayList<org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType>(other.workflowInputs.size());
      for (org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType other_element : other.workflowInputs) {
        __this__workflowInputs.add(new org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType(other_element));
      }
      this.workflowInputs = __this__workflowInputs;
    }
    if (other.isSetWorkflowOutputs()) {
      List<org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType> __this__workflowOutputs = new ArrayList<org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType>(other.workflowOutputs.size());
      for (org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType other_element : other.workflowOutputs) {
        __this__workflowOutputs.add(new org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType(other_element));
      }
      this.workflowOutputs = __this__workflowOutputs;
    }
  }

  public Workflow deepCopy() {
    return new Workflow(this);
  }

  @Override
  public void clear() {
    this.templateId = "DO_NOT_SET_AT_CLIENTS";

    this.name = null;
    this.graph = null;
    this.image = null;
    this.workflowInputs = null;
    this.workflowOutputs = null;
  }

  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 byte[] getImage() {
    setImage(org.apache.thrift.TBaseHelper.rightSize(image));
    return image == null ? null : image.array();
  }

  public ByteBuffer bufferForImage() {
    return image;
  }

  public void setImage(byte[] image) {
    setImage(image == null ? (ByteBuffer)null : ByteBuffer.wrap(image));
  }

  public void setImage(ByteBuffer image) {
    this.image = 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<org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType> getWorkflowInputsIterator() {
    return (this.workflowInputs == null) ? null : this.workflowInputs.iterator();
  }

  public void addToWorkflowInputs(org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType elem) {
    if (this.workflowInputs == null) {
      this.workflowInputs = new ArrayList<org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType>();
    }
    this.workflowInputs.add(elem);
  }

  public List<org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType> getWorkflowInputs() {
    return this.workflowInputs;
  }

  public void setWorkflowInputs(List<org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType> 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<org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType> getWorkflowOutputsIterator() {
    return (this.workflowOutputs == null) ? null : this.workflowOutputs.iterator();
  }

  public void addToWorkflowOutputs(org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType elem) {
    if (this.workflowOutputs == null) {
      this.workflowOutputs = new ArrayList<org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType>();
    }
    this.workflowOutputs.add(elem);
  }

  public List<org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType> getWorkflowOutputs() {
    return this.workflowOutputs;
  }

  public void setWorkflowOutputs(List<org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType> 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 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 IMAGE:
      if (value == null) {
        unsetImage();
      } else {
        setImage((ByteBuffer)value);
      }
      break;

    case WORKFLOW_INPUTS:
      if (value == null) {
        unsetWorkflowInputs();
      } else {
        setWorkflowInputs((List<org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType>)value);
      }
      break;

    case WORKFLOW_OUTPUTS:
      if (value == null) {
        unsetWorkflowOutputs();
      } else {
        setWorkflowOutputs((List<org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType>)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case TEMPLATE_ID:
      return getTemplateId();

    case NAME:
      return getName();

    case GRAPH:
      return getGraph();

    case IMAGE:
      return getImage();

    case WORKFLOW_INPUTS:
      return getWorkflowInputs();

    case WORKFLOW_OUTPUTS:
      return getWorkflowOutputs();

    }
    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 IMAGE:
      return isSetImage();
    case WORKFLOW_INPUTS:
      return isSetWorkflowInputs();
    case WORKFLOW_OUTPUTS:
      return isSetWorkflowOutputs();
    }
    throw new IllegalStateException();
  }

  @Override
  public boolean equals(Object that) {
    if (that == null)
      return false;
    if (that instanceof Workflow)
      return this.equals((Workflow)that);
    return false;
  }

  public boolean equals(Workflow 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_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;
    }

    return true;
  }

  @Override
  public int hashCode() {
    return 0;
  }

  @Override
  public int compareTo(Workflow other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetTemplateId()).compareTo(other.isSetTemplateId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTemplateId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.templateId, other.templateId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetName()).compareTo(other.isSetName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetGraph()).compareTo(other.isSetGraph());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetGraph()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.graph, other.graph);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetImage()).compareTo(other.isSetImage());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetImage()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.image, other.image);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetWorkflowInputs()).compareTo(other.isSetWorkflowInputs());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetWorkflowInputs()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.workflowInputs, other.workflowInputs);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetWorkflowOutputs()).compareTo(other.isSetWorkflowOutputs());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetWorkflowOutputs()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.workflowOutputs, other.workflowOutputs);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
  }

  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder("Workflow(");
    boolean first = true;

    sb.append("templateId:");
    if (this.templateId == null) {
      sb.append("null");
    } else {
      sb.append(this.templateId);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("name:");
    if (this.name == null) {
      sb.append("null");
    } else {
      sb.append(this.name);
    }
    first = false;
    if (isSetGraph()) {
      if (!first) sb.append(", ");
      sb.append("graph:");
      if (this.graph == null) {
        sb.append("null");
      } else {
        sb.append(this.graph);
      }
      first = false;
    }
    if (isSetImage()) {
      if (!first) sb.append(", ");
      sb.append("image:");
      if (this.image == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.image, sb);
      }
      first = false;
    }
    if (isSetWorkflowInputs()) {
      if (!first) sb.append(", ");
      sb.append("workflowInputs:");
      if (this.workflowInputs == null) {
        sb.append("null");
      } else {
        sb.append(this.workflowInputs);
      }
      first = false;
    }
    if (isSetWorkflowOutputs()) {
      if (!first) sb.append(", ");
      sb.append("workflowOutputs:");
      if (this.workflowOutputs == null) {
        sb.append("null");
      } else {
        sb.append(this.workflowOutputs);
      }
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    if (!isSetTemplateId()) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'templateId' is unset! Struct:" + toString());
    }

    if (!isSetName()) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'name' is unset! Struct:" + toString());
    }

    // check for sub-struct validity
  }

  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    try {
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
    try {
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private static class WorkflowStandardSchemeFactory implements SchemeFactory {
    public WorkflowStandardScheme getScheme() {
      return new WorkflowStandardScheme();
    }
  }

  private static class WorkflowStandardScheme extends StandardScheme<Workflow> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, Workflow struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true)
      {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
          break;
        }
        switch (schemeField.id) {
          case 1: // TEMPLATE_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.templateId = iprot.readString();
              struct.setTemplateIdIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.name = iprot.readString();
              struct.setNameIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // GRAPH
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.graph = iprot.readString();
              struct.setGraphIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // IMAGE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.image = iprot.readBinary();
              struct.setImageIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // WORKFLOW_INPUTS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
                struct.workflowInputs = new ArrayList<org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType>(_list0.size);
                for (int _i1 = 0; _i1 < _list0.size; ++_i1)
                {
                  org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType _elem2;
                  _elem2 = new org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType();
                  _elem2.read(iprot);
                  struct.workflowInputs.add(_elem2);
                }
                iprot.readListEnd();
              }
              struct.setWorkflowInputsIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // WORKFLOW_OUTPUTS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list3 = iprot.readListBegin();
                struct.workflowOutputs = new ArrayList<org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType>(_list3.size);
                for (int _i4 = 0; _i4 < _list3.size; ++_i4)
                {
                  org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType _elem5;
                  _elem5 = new org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType();
                  _elem5.read(iprot);
                  struct.workflowOutputs.add(_elem5);
                }
                iprot.readListEnd();
              }
              struct.setWorkflowOutputsIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      struct.validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot, Workflow struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.templateId != null) {
        oprot.writeFieldBegin(TEMPLATE_ID_FIELD_DESC);
        oprot.writeString(struct.templateId);
        oprot.writeFieldEnd();
      }
      if (struct.name != null) {
        oprot.writeFieldBegin(NAME_FIELD_DESC);
        oprot.writeString(struct.name);
        oprot.writeFieldEnd();
      }
      if (struct.graph != null) {
        if (struct.isSetGraph()) {
          oprot.writeFieldBegin(GRAPH_FIELD_DESC);
          oprot.writeString(struct.graph);
          oprot.writeFieldEnd();
        }
      }
      if (struct.image != null) {
        if (struct.isSetImage()) {
          oprot.writeFieldBegin(IMAGE_FIELD_DESC);
          oprot.writeBinary(struct.image);
          oprot.writeFieldEnd();
        }
      }
      if (struct.workflowInputs != null) {
        if (struct.isSetWorkflowInputs()) {
          oprot.writeFieldBegin(WORKFLOW_INPUTS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.workflowInputs.size()));
            for (org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType _iter6 : struct.workflowInputs)
            {
              _iter6.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.workflowOutputs != null) {
        if (struct.isSetWorkflowOutputs()) {
          oprot.writeFieldBegin(WORKFLOW_OUTPUTS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.workflowOutputs.size()));
            for (org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType _iter7 : struct.workflowOutputs)
            {
              _iter7.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class WorkflowTupleSchemeFactory implements SchemeFactory {
    public WorkflowTupleScheme getScheme() {
      return new WorkflowTupleScheme();
    }
  }

  private static class WorkflowTupleScheme extends TupleScheme<Workflow> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, Workflow struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      oprot.writeString(struct.templateId);
      oprot.writeString(struct.name);
      BitSet optionals = new BitSet();
      if (struct.isSetGraph()) {
        optionals.set(0);
      }
      if (struct.isSetImage()) {
        optionals.set(1);
      }
      if (struct.isSetWorkflowInputs()) {
        optionals.set(2);
      }
      if (struct.isSetWorkflowOutputs()) {
        optionals.set(3);
      }
      oprot.writeBitSet(optionals, 4);
      if (struct.isSetGraph()) {
        oprot.writeString(struct.graph);
      }
      if (struct.isSetImage()) {
        oprot.writeBinary(struct.image);
      }
      if (struct.isSetWorkflowInputs()) {
        {
          oprot.writeI32(struct.workflowInputs.size());
          for (org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType _iter8 : struct.workflowInputs)
          {
            _iter8.write(oprot);
          }
        }
      }
      if (struct.isSetWorkflowOutputs()) {
        {
          oprot.writeI32(struct.workflowOutputs.size());
          for (org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType _iter9 : struct.workflowOutputs)
          {
            _iter9.write(oprot);
          }
        }
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, Workflow struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      struct.templateId = iprot.readString();
      struct.setTemplateIdIsSet(true);
      struct.name = iprot.readString();
      struct.setNameIsSet(true);
      BitSet incoming = iprot.readBitSet(4);
      if (incoming.get(0)) {
        struct.graph = iprot.readString();
        struct.setGraphIsSet(true);
      }
      if (incoming.get(1)) {
        struct.image = iprot.readBinary();
        struct.setImageIsSet(true);
      }
      if (incoming.get(2)) {
        {
          org.apache.thrift.protocol.TList _list10 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
          struct.workflowInputs = new ArrayList<org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType>(_list10.size);
          for (int _i11 = 0; _i11 < _list10.size; ++_i11)
          {
            org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType _elem12;
            _elem12 = new org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType();
            _elem12.read(iprot);
            struct.workflowInputs.add(_elem12);
          }
        }
        struct.setWorkflowInputsIsSet(true);
      }
      if (incoming.get(3)) {
        {
          org.apache.thrift.protocol.TList _list13 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
          struct.workflowOutputs = new ArrayList<org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType>(_list13.size);
          for (int _i14 = 0; _i14 < _list13.size; ++_i14)
          {
            org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType _elem15;
            _elem15 = new org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType();
            _elem15.read(iprot);
            struct.workflowOutputs.add(_elem15);
          }
        }
        struct.setWorkflowOutputsIsSet(true);
      }
    }
  }

}