text:
/**
 * Autogenerated by Thrift Compiler (0.9.3)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package com.facebook.buck.distributed.thrift;

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 = "2017-04-10")
public class BuildJobState implements org.apache.thrift.TBase<BuildJobState, BuildJobState._Fields>, java.io.Serializable, Cloneable, Comparable<BuildJobState> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("BuildJobState");

  private static final org.apache.thrift.protocol.TField CELLS_FIELD_DESC = new org.apache.thrift.protocol.TField("cells", org.apache.thrift.protocol.TType.MAP, (short)1);
  private static final org.apache.thrift.protocol.TField FILE_HASHES_FIELD_DESC = new org.apache.thrift.protocol.TField("fileHashes", org.apache.thrift.protocol.TType.LIST, (short)2);
  private static final org.apache.thrift.protocol.TField TARGET_GRAPH_FIELD_DESC = new org.apache.thrift.protocol.TField("targetGraph", org.apache.thrift.protocol.TType.STRUCT, (short)3);
  private static final org.apache.thrift.protocol.TField TOP_LEVEL_TARGETS_FIELD_DESC = new org.apache.thrift.protocol.TField("topLevelTargets", org.apache.thrift.protocol.TType.LIST, (short)4);

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

  public Map<Integer,BuildJobStateCell> cells; // optional
  public List<BuildJobStateFileHashes> fileHashes; // optional
  public BuildJobStateTargetGraph targetGraph; // optional
  public List<String> topLevelTargets; // 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 {
    CELLS((short)1, "cells"),
    FILE_HASHES((short)2, "fileHashes"),
    TARGET_GRAPH((short)3, "targetGraph"),
    TOP_LEVEL_TARGETS((short)4, "topLevelTargets");

    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: // CELLS
          return CELLS;
        case 2: // FILE_HASHES
          return FILE_HASHES;
        case 3: // TARGET_GRAPH
          return TARGET_GRAPH;
        case 4: // TOP_LEVEL_TARGETS
          return TOP_LEVEL_TARGETS;
        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 _Fields optionals[] = {_Fields.CELLS,_Fields.FILE_HASHES,_Fields.TARGET_GRAPH,_Fields.TOP_LEVEL_TARGETS};
  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.CELLS, new org.apache.thrift.meta_data.FieldMetaData("cells", org.apache.thrift.TFieldRequirementType.OPTIONAL,
        new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32),
            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, BuildJobStateCell.class))));
    tmpMap.put(_Fields.FILE_HASHES, new org.apache.thrift.meta_data.FieldMetaData("fileHashes", 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, BuildJobStateFileHashes.class))));
    tmpMap.put(_Fields.TARGET_GRAPH, new org.apache.thrift.meta_data.FieldMetaData("targetGraph", org.apache.thrift.TFieldRequirementType.OPTIONAL,
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, BuildJobStateTargetGraph.class)));
    tmpMap.put(_Fields.TOP_LEVEL_TARGETS, new org.apache.thrift.meta_data.FieldMetaData("topLevelTargets", org.apache.thrift.TFieldRequirementType.OPTIONAL,
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(BuildJobState.class, metaDataMap);
  }

  public BuildJobState() {
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public BuildJobState(BuildJobState other) {
    if (other.isSetCells()) {
      Map<Integer,BuildJobStateCell> __this__cells = new HashMap<Integer,BuildJobStateCell>(other.cells.size());
      for (Map.Entry<Integer, BuildJobStateCell> other_element : other.cells.entrySet()) {

        Integer other_element_key = other_element.getKey();
        BuildJobStateCell other_element_value = other_element.getValue();

        Integer __this__cells_copy_key = other_element_key;

        BuildJobStateCell __this__cells_copy_value = new BuildJobStateCell(other_element_value);

        __this__cells.put(__this__cells_copy_key, __this__cells_copy_value);
      }
      this.cells = __this__cells;
    }
    if (other.isSetFileHashes()) {
      List<BuildJobStateFileHashes> __this__fileHashes = new ArrayList<BuildJobStateFileHashes>(other.fileHashes.size());
      for (BuildJobStateFileHashes other_element : other.fileHashes) {
        __this__fileHashes.add(new BuildJobStateFileHashes(other_element));
      }
      this.fileHashes = __this__fileHashes;
    }
    if (other.isSetTargetGraph()) {
      this.targetGraph = new BuildJobStateTargetGraph(other.targetGraph);
    }
    if (other.isSetTopLevelTargets()) {
      List<String> __this__topLevelTargets = new ArrayList<String>(other.topLevelTargets);
      this.topLevelTargets = __this__topLevelTargets;
    }
  }

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

  @Override
  public void clear() {
    this.cells = null;
    this.fileHashes = null;
    this.targetGraph = null;
    this.topLevelTargets = null;
  }

  public int getCellsSize() {
    return (this.cells == null) ? 0 : this.cells.size();
  }

  public void putToCells(int key, BuildJobStateCell val) {
    if (this.cells == null) {
      this.cells = new HashMap<Integer,BuildJobStateCell>();
    }
    this.cells.put(key, val);
  }

  public Map<Integer,BuildJobStateCell> getCells() {
    return this.cells;
  }

  public BuildJobState setCells(Map<Integer,BuildJobStateCell> cells) {
    this.cells = cells;
    return this;
  }

  public void unsetCells() {
    this.cells = null;
  }

  /** Returns true if field cells is set (has been assigned a value) and false otherwise */
  public boolean isSetCells() {
    return this.cells != null;
  }

  public void setCellsIsSet(boolean value) {
    if (!value) {
      this.cells = null;
    }
  }

  public int getFileHashesSize() {
    return (this.fileHashes == null) ? 0 : this.fileHashes.size();
  }

  public java.util.Iterator<BuildJobStateFileHashes> getFileHashesIterator() {
    return (this.fileHashes == null) ? null : this.fileHashes.iterator();
  }

  public void addToFileHashes(BuildJobStateFileHashes elem) {
    if (this.fileHashes == null) {
      this.fileHashes = new ArrayList<BuildJobStateFileHashes>();
    }
    this.fileHashes.add(elem);
  }

  public List<BuildJobStateFileHashes> getFileHashes() {
    return this.fileHashes;
  }

  public BuildJobState setFileHashes(List<BuildJobStateFileHashes> fileHashes) {
    this.fileHashes = fileHashes;
    return this;
  }

  public void unsetFileHashes() {
    this.fileHashes = null;
  }

  /** Returns true if field fileHashes is set (has been assigned a value) and false otherwise */
  public boolean isSetFileHashes() {
    return this.fileHashes != null;
  }

  public void setFileHashesIsSet(boolean value) {
    if (!value) {
      this.fileHashes = null;
    }
  }

  public BuildJobStateTargetGraph getTargetGraph() {
    return this.targetGraph;
  }

  public BuildJobState setTargetGraph(BuildJobStateTargetGraph targetGraph) {
    this.targetGraph = targetGraph;
    return this;
  }

  public void unsetTargetGraph() {
    this.targetGraph = null;
  }

  /** Returns true if field targetGraph is set (has been assigned a value) and false otherwise */
  public boolean isSetTargetGraph() {
    return this.targetGraph != null;
  }

  public void setTargetGraphIsSet(boolean value) {
    if (!value) {
      this.targetGraph = null;
    }
  }

  public int getTopLevelTargetsSize() {
    return (this.topLevelTargets == null) ? 0 : this.topLevelTargets.size();
  }

  public java.util.Iterator<String> getTopLevelTargetsIterator() {
    return (this.topLevelTargets == null) ? null : this.topLevelTargets.iterator();
  }

  public void addToTopLevelTargets(String elem) {
    if (this.topLevelTargets == null) {
      this.topLevelTargets = new ArrayList<String>();
    }
    this.topLevelTargets.add(elem);
  }

  public List<String> getTopLevelTargets() {
    return this.topLevelTargets;
  }

  public BuildJobState setTopLevelTargets(List<String> topLevelTargets) {
    this.topLevelTargets = topLevelTargets;
    return this;
  }

  public void unsetTopLevelTargets() {
    this.topLevelTargets = null;
  }

  /** Returns true if field topLevelTargets is set (has been assigned a value) and false otherwise */
  public boolean isSetTopLevelTargets() {
    return this.topLevelTargets != null;
  }

  public void setTopLevelTargetsIsSet(boolean value) {
    if (!value) {
      this.topLevelTargets = null;
    }
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case CELLS:
      if (value == null) {
        unsetCells();
      } else {
        setCells((Map<Integer,BuildJobStateCell>)value);
      }
      break;

    case FILE_HASHES:
      if (value == null) {
        unsetFileHashes();
      } else {
        setFileHashes((List<BuildJobStateFileHashes>)value);
      }
      break;

    case TARGET_GRAPH:
      if (value == null) {
        unsetTargetGraph();
      } else {
        setTargetGraph((BuildJobStateTargetGraph)value);
      }
      break;

    case TOP_LEVEL_TARGETS:
      if (value == null) {
        unsetTopLevelTargets();
      } else {
        setTopLevelTargets((List<String>)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case CELLS:
      return getCells();

    case FILE_HASHES:
      return getFileHashes();

    case TARGET_GRAPH:
      return getTargetGraph();

    case TOP_LEVEL_TARGETS:
      return getTopLevelTargets();

    }
    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 CELLS:
      return isSetCells();
    case FILE_HASHES:
      return isSetFileHashes();
    case TARGET_GRAPH:
      return isSetTargetGraph();
    case TOP_LEVEL_TARGETS:
      return isSetTopLevelTargets();
    }
    throw new IllegalStateException();
  }

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

  public boolean equals(BuildJobState that) {
    if (that == null)
      return false;

    boolean this_present_cells = true && this.isSetCells();
    boolean that_present_cells = true && that.isSetCells();
    if (this_present_cells || that_present_cells) {
      if (!(this_present_cells && that_present_cells))
        return false;
      if (!this.cells.equals(that.cells))
        return false;
    }

    boolean this_present_fileHashes = true && this.isSetFileHashes();
    boolean that_present_fileHashes = true && that.isSetFileHashes();
    if (this_present_fileHashes || that_present_fileHashes) {
      if (!(this_present_fileHashes && that_present_fileHashes))
        return false;
      if (!this.fileHashes.equals(that.fileHashes))
        return false;
    }

    boolean this_present_targetGraph = true && this.isSetTargetGraph();
    boolean that_present_targetGraph = true && that.isSetTargetGraph();
    if (this_present_targetGraph || that_present_targetGraph) {
      if (!(this_present_targetGraph && that_present_targetGraph))
        return false;
      if (!this.targetGraph.equals(that.targetGraph))
        return false;
    }

    boolean this_present_topLevelTargets = true && this.isSetTopLevelTargets();
    boolean that_present_topLevelTargets = true && that.isSetTopLevelTargets();
    if (this_present_topLevelTargets || that_present_topLevelTargets) {
      if (!(this_present_topLevelTargets && that_present_topLevelTargets))
        return false;
      if (!this.topLevelTargets.equals(that.topLevelTargets))
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    List<Object> list = new ArrayList<Object>();

    boolean present_cells = true && (isSetCells());
    list.add(present_cells);
    if (present_cells)
      list.add(cells);

    boolean present_fileHashes = true && (isSetFileHashes());
    list.add(present_fileHashes);
    if (present_fileHashes)
      list.add(fileHashes);

    boolean present_targetGraph = true && (isSetTargetGraph());
    list.add(present_targetGraph);
    if (present_targetGraph)
      list.add(targetGraph);

    boolean present_topLevelTargets = true && (isSetTopLevelTargets());
    list.add(present_topLevelTargets);
    if (present_topLevelTargets)
      list.add(topLevelTargets);

    return list.hashCode();
  }

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

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetCells()).compareTo(other.isSetCells());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCells()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cells, other.cells);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetFileHashes()).compareTo(other.isSetFileHashes());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFileHashes()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fileHashes, other.fileHashes);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTargetGraph()).compareTo(other.isSetTargetGraph());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTargetGraph()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.targetGraph, other.targetGraph);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTopLevelTargets()).compareTo(other.isSetTopLevelTargets());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTopLevelTargets()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.topLevelTargets, other.topLevelTargets);
      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("BuildJobState(");
    boolean first = true;

    if (isSetCells()) {
      sb.append("cells:");
      if (this.cells == null) {
        sb.append("null");
      } else {
        sb.append(this.cells);
      }
      first = false;
    }
    if (isSetFileHashes()) {
      if (!first) sb.append(", ");
      sb.append("fileHashes:");
      if (this.fileHashes == null) {
        sb.append("null");
      } else {
        sb.append(this.fileHashes);
      }
      first = false;
    }
    if (isSetTargetGraph()) {
      if (!first) sb.append(", ");
      sb.append("targetGraph:");
      if (this.targetGraph == null) {
        sb.append("null");
      } else {
        sb.append(this.targetGraph);
      }
      first = false;
    }
    if (isSetTopLevelTargets()) {
      if (!first) sb.append(", ");
      sb.append("topLevelTargets:");
      if (this.topLevelTargets == null) {
        sb.append("null");
      } else {
        sb.append(this.topLevelTargets);
      }
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // check for sub-struct validity
    if (targetGraph != null) {
      targetGraph.validate();
    }
  }

  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 BuildJobStateStandardSchemeFactory implements SchemeFactory {
    public BuildJobStateStandardScheme getScheme() {
      return new BuildJobStateStandardScheme();
    }
  }

  private static class BuildJobStateStandardScheme extends StandardScheme<BuildJobState> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, BuildJobState 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: // CELLS
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map70 = iprot.readMapBegin();
                struct.cells = new HashMap<Integer,BuildJobStateCell>(2*_map70.size);
                int _key71;
                BuildJobStateCell _val72;
                for (int _i73 = 0; _i73 < _map70.size; ++_i73)
                {
                  _key71 = iprot.readI32();
                  _val72 = new BuildJobStateCell();
                  _val72.read(iprot);
                  struct.cells.put(_key71, _val72);
                }
                iprot.readMapEnd();
              }
              struct.setCellsIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // FILE_HASHES
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list74 = iprot.readListBegin();
                struct.fileHashes = new ArrayList<BuildJobStateFileHashes>(_list74.size);
                BuildJobStateFileHashes _elem75;
                for (int _i76 = 0; _i76 < _list74.size; ++_i76)
                {
                  _elem75 = new BuildJobStateFileHashes();
                  _elem75.read(iprot);
                  struct.fileHashes.add(_elem75);
                }
                iprot.readListEnd();
              }
              struct.setFileHashesIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // TARGET_GRAPH
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.targetGraph = new BuildJobStateTargetGraph();
              struct.targetGraph.read(iprot);
              struct.setTargetGraphIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // TOP_LEVEL_TARGETS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list77 = iprot.readListBegin();
                struct.topLevelTargets = new ArrayList<String>(_list77.size);
                String _elem78;
                for (int _i79 = 0; _i79 < _list77.size; ++_i79)
                {
                  _elem78 = iprot.readString();
                  struct.topLevelTargets.add(_elem78);
                }
                iprot.readListEnd();
              }
              struct.setTopLevelTargetsIsSet(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();

      // check for required fields of primitive type, which can't be checked in the validate method
      struct.validate();
    }

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

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.cells != null) {
        if (struct.isSetCells()) {
          oprot.writeFieldBegin(CELLS_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRUCT, struct.cells.size()));
            for (Map.Entry<Integer, BuildJobStateCell> _iter80 : struct.cells.entrySet())
            {
              oprot.writeI32(_iter80.getKey());
              _iter80.getValue().write(oprot);
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.fileHashes != null) {
        if (struct.isSetFileHashes()) {
          oprot.writeFieldBegin(FILE_HASHES_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.fileHashes.size()));
            for (BuildJobStateFileHashes _iter81 : struct.fileHashes)
            {
              _iter81.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.targetGraph != null) {
        if (struct.isSetTargetGraph()) {
          oprot.writeFieldBegin(TARGET_GRAPH_FIELD_DESC);
          struct.targetGraph.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.topLevelTargets != null) {
        if (struct.isSetTopLevelTargets()) {
          oprot.writeFieldBegin(TOP_LEVEL_TARGETS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.topLevelTargets.size()));
            for (String _iter82 : struct.topLevelTargets)
            {
              oprot.writeString(_iter82);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class BuildJobStateTupleSchemeFactory implements SchemeFactory {
    public BuildJobStateTupleScheme getScheme() {
      return new BuildJobStateTupleScheme();
    }
  }

  private static class BuildJobStateTupleScheme extends TupleScheme<BuildJobState> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, BuildJobState struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetCells()) {
        optionals.set(0);
      }
      if (struct.isSetFileHashes()) {
        optionals.set(1);
      }
      if (struct.isSetTargetGraph()) {
        optionals.set(2);
      }
      if (struct.isSetTopLevelTargets()) {
        optionals.set(3);
      }
      oprot.writeBitSet(optionals, 4);
      if (struct.isSetCells()) {
        {
          oprot.writeI32(struct.cells.size());
          for (Map.Entry<Integer, BuildJobStateCell> _iter83 : struct.cells.entrySet())
          {
            oprot.writeI32(_iter83.getKey());
            _iter83.getValue().write(oprot);
          }
        }
      }
      if (struct.isSetFileHashes()) {
        {
          oprot.writeI32(struct.fileHashes.size());
          for (BuildJobStateFileHashes _iter84 : struct.fileHashes)
          {
            _iter84.write(oprot);
          }
        }
      }
      if (struct.isSetTargetGraph()) {
        struct.targetGraph.write(oprot);
      }
      if (struct.isSetTopLevelTargets()) {
        {
          oprot.writeI32(struct.topLevelTargets.size());
          for (String _iter85 : struct.topLevelTargets)
          {
            oprot.writeString(_iter85);
          }
        }
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, BuildJobState struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(4);
      if (incoming.get(0)) {
        {
          org.apache.thrift.protocol.TMap _map86 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
          struct.cells = new HashMap<Integer,BuildJobStateCell>(2*_map86.size);
          int _key87;
          BuildJobStateCell _val88;
          for (int _i89 = 0; _i89 < _map86.size; ++_i89)
          {
            _key87 = iprot.readI32();
            _val88 = new BuildJobStateCell();
            _val88.read(iprot);
            struct.cells.put(_key87, _val88);
          }
        }
        struct.setCellsIsSet(true);
      }
      if (incoming.get(1)) {
        {
          org.apache.thrift.protocol.TList _list90 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
          struct.fileHashes = new ArrayList<BuildJobStateFileHashes>(_list90.size);
          BuildJobStateFileHashes _elem91;
          for (int _i92 = 0; _i92 < _list90.size; ++_i92)
          {
            _elem91 = new BuildJobStateFileHashes();
            _elem91.read(iprot);
            struct.fileHashes.add(_elem91);
          }
        }
        struct.setFileHashesIsSet(true);
      }
      if (incoming.get(2)) {
        struct.targetGraph = new BuildJobStateTargetGraph();
        struct.targetGraph.read(iprot);
        struct.setTargetGraphIsSet(true);
      }
      if (incoming.get(3)) {
        {
          org.apache.thrift.protocol.TList _list93 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.topLevelTargets = new ArrayList<String>(_list93.size);
          String _elem94;
          for (int _i95 = 0; _i95 < _list93.size; ++_i95)
          {
            _elem94 = iprot.readString();
            struct.topLevelTargets.add(_elem94);
          }
        }
        struct.setTopLevelTargetsIsSet(true);
      }
    }
  }

}


text:
package com.mercadopago.android.px.mocks;

import android.support.annotation.NonNull;
import com.mercadopago.android.px.model.ExpressMetadata;

public enum ExpressMetadataStub implements JsonInjectable<ExpressMetadata> {
    DEFAULT;

    @NonNull
    @Override
    public ExpressMetadata get() {
        return null;
    }

    @NonNull
    @Override
    public String getJson() {
        return "";
    }

    @NonNull
    @Override
    public String getType() {
        return "%EXPRESS_METADATA%";
    }
}

redpajama_set_name: RedPajamaGithub


text:
/**
 *
 */
package com.github.nnest.sparrow.rest.command.indices;

import java.io.InputStream;

import com.github.nnest.sparrow.ElasticCommandKind;
import com.github.nnest.sparrow.ElasticCommandResultData;
import com.github.nnest.sparrow.ElasticExecutorException;
import com.github.nnest.sparrow.command.indices.DropIndex;
import com.github.nnest.sparrow.rest.ElasticRestMethod;
import com.github.nnest.sparrow.rest.command.AbstractRestCommand;

/**
 * rest command {@linkplain ElasticCommandKind#DROP_INDEX}
 *
 * @author brad.wu
 * @since 0.0.1
 * @version 0.0.1
 */
public class RestCommandDropIndex extends AbstractRestCommand<DropIndex, ElasticCommandResultData> {
	/**
	 * return null
	 *
	 * @see com.github.nnest.sparrow.rest.command.AbstractRestCommand#readResponse(com.github.nnest.sparrow.ElasticCommand,
	 *      java.io.InputStream)
	 */
	@Override
	protected ElasticCommandResultData readResponse(DropIndex command, InputStream stream)
			throws ElasticExecutorException {
		return null;
	}

	/**
	 * no response, return null here
	 *
	 * @see com.github.nnest.sparrow.rest.command.AbstractRestCommand#getResponseClass()
	 */
	@Override
	protected Class<ElasticCommandResultData> getResponseClass() {
		return null;
	}

	/**
	 * (non-Javadoc)
	 *
	 * @see com.github.nnest.sparrow.rest.command.AbstractRestCommand#convertToRestRequest(com.github.nnest.sparrow.ElasticCommand)
	 */
	@Override
	protected RestRequest convertToRestRequest(DropIndex command) throws ElasticExecutorException {
		RestRequest request = new RestRequest();

		request.setEndpoint("/" + command.getIndexName());
		// use PUT for id given
		request.setMethod(ElasticRestMethod.DELETE.name());
		return request;
	}
}


text:
The new xslt view supports an extensible Java XML adapter framework that makes
it easy to customize the XML rendering of objects and to incorporate structured
XML text and arbitarary DOM fragments into the output.

The XSLTResult class now uses an extensible adapter factory for rendering the
Struts action Java object tree to an XML DOM for consumption by the
stylesheet.  Users can easily register their own adapters to produce custom XML
views of Java types or simply extend a default "String" adapter and return
plain or XML text to be incorporated into the DOM.  The new adapter mechanism
is capable of proxying existing DOM trees and incorporating them into the
results, so you can freely mix DOMs produced from other sources into your
result tree.

A default java.util.Map adapter is also now provided to render Maps to XML.

Please see the javadoc on the AdapterFactory for more details.


text:
========
Usage
========

To use Sample Project in a project::

	import sample_project


text:
layout: page
title: Resources
---

## Links for data visualization literacy

###[Source, via Knight Mozilla's OpenNews](https://source.opennews.org/en-US/)

Thought leaders in the online journalism discuss and share best practices on data journalism and news application development.

* [Surviving the News Business](https://source.opennews.org/en-US/articles/surviving-news-business/)
* [How We Made "Failure Factories"](https://source.opennews.org/en-US/articles/how-we-made-failure-factories/)
* [If Your Reporters Aren't Making Their Own Charts You're Wasting Everyone's Time](https://source.opennews.org/en-US/articles/reporters-making-charts/)
* [Rethinking the Building Blocks of a Chronicle Interactive](https://source.opennews.org/en-US/articles/rethinking-building-blocks-chronicle-interactive/)

###[Storybench, via Northeastern University](http://www.storybench.org/)

Showcases innovative online storytelling techniques and explains the process for others to reproduce.

* [How the Wall Street Journal built a series of artful animations for an investigative series](http://www.storybench.org/wall-street-journal-built-series-artful-animations-investigative-series/)
* [How Scientific American makes its infographics](http://www.storybench.org/how-scientific-american-makes-its-infographics/)
* [How to create a GIF from a video, a screencast, or a bunch of images](http://www.storybench.org/how-to-create-a-gif/)
* [How to build a Google Spreadsheet that auto-tweets your archives](http://www.storybench.org/build-google-spreadsheet-auto-tweets-archives/)

###[Investigative Reporters and Editors](http://ire.org/tag/behind-the-story/)

A wonderful organization dedicated to improving the quality of investigative reporting. Their [blog](http://ire.org/blog/ire-news/), [podcast](https://itunes.apple.com/us/podcast/ire-radio-podcast/id900544465?mt=2) and listserv is excellent to pick up ideas for future projects or stories. Their [Behind the Story](http://ire.org/tag/behind-the-story/) posts detail how reporters broke huge, impactful stories.

* [How USA TODAY pieced together a confidential FBI database to count fugitives who go free](http://ire.org/blog/ire-news/2014/03/31/behind-story-how-usa-today-pieced-together-confide/)
* [How the WSJ uncovered a flawed system of reporting police killings](http://ire.org/blog/ire-news/2015/01/29/behind-story-how-wsj-uncovered-flawed-system-repor/)
* [Investigative Reporters and Editors | Behind the Story: How NPR and ProPublica exposed problems with the Red Cross' response to Superstorm Sandy](http://ire.org/blog/ire-news/2014/11/19/behind-story-how-npr-and-propublica-exposed-proble/)

## Walkthroughs from class

* [How to make pivot tables in Google Sheets](http://trendct.org/2015/09/04/tutorial-how-to-make-pivot-tables-in-google-sheets/)
* [Getting started with Github desktop app](http://andrewbtran.github.io/JRN-418/github_app/)
* [Investigating homicide stats](http://andrewbtran.github.io/JRN-418/homicide_stats/)
* [Introduction to Plotly](http://andrewbtran.github.io/JRN-418/class3/plotly.html#/)
* [Joining with Google Fusion Tables](http://andrewbtran.github.io/JRN-418/class4/joining/)
* [Extracting data from a PDF](http://andrewbtran.github.io/JRN-418/class5/pdf_converter/)
* [Joining data and making a map with Google Fusion table](http://andrewbtran.github.io/JRN-418/class5/fusion_map/)
* [The different types of data vizualizations](http://andrewbtran.github.io/JRN-418/class6/vizualizationtypes.html) (And links to how to make them)
* [More Fusion Tables fun - Choropleth maps](http://andrewbtran.github.io/JRN-418/class6/choropleths_fusion/)
* [Cleaning up data with Open Refine](http://andrewbtran.github.io/JRN-418/class7/openrefine/)
* [Scraping data with Data Miner](http://andrewbtran.github.io/JRN-418/class7/scraping_intro/)
* [Scraping data without programming using Import.io](http://andrewbtran.github.io/JRN-418/class7/importio/)
* [Some advanced data work in Open Refine](http://andrewbtran.github.io/JRN-418/class8/openrefine_advanced/)
* [Another way to make a Choropleth map](http://andrewbtran.github.io/JRN-418/class10/choropleth/)
* [Gathering data by using IFTTT](http://andrewbtran.github.io/JRN-418/class10/ifttt/)
* [Hosting your website on Github Pages](http://andrewbtran.github.io/JRN-418/class6/ghpages/)
* [Introduction to CartoDB](http://andrewbtran.github.io/JRN-418/class11/cartodb/)
* [Advanced CartoDB](http://andrewbtran.github.io/JRN-418/class11/cartodb_2/)
* [Timelines and story maps](http://andrewbtran.github.io/JRN-418/class12/timelines.html)
* [Getting and visualizing Census data]({{ site.url }}/class13/census_viz)
* [Using Census Reporter]({{ site.url }}/class13/census_reporter)
* [Github Redux]({{ site.url }}/class13/github_redux.html)
* [Build a blog with Jekyll and Github Pages]({{ site.url }}/class13/jekyll)
* [Highcharts.JS walkthrough](http://andrewbtran.github.io/JRN-418/class13/highcharts)
* [Converting data to JSON format](http://andrewbtran.github.io/JRN-418/class13/json_convert)
* [Making D3 charts using D3Plus.js](http://andrewbtran.github.io/JRN-418/class14/d3plus)
* [Leaflet map walkthrough](http://andrewbtran.github.io/JRN-418/class13/leafletjs)
* [Intro to R]({{ site.url }}/class15/introtor)
* [Making a map with R]({{ site.url }}/class15/leafletviar)
* [More advanced visualizations with R](http://andrewbtran.github.io/viz-in-r/viz-in-r.html)

## Extra links

<iframe id="graphic" style="width: 100%; height: 600px; overflow: hidden; margin-left:-25px;" frameborder="0" scrolling="no" src="http://projects.ctmirror.org/tools/fancytable/table.html?d=Datajournalismresources-0-7-2015-8075"/></iframe>


text:
/**
 * Created by feng on 16/12/8.
 */

import React, { Component } from 'react';
import {
    AppRegistry,
    StyleSheet,
    Text,
    View,
    TouchableOpacity,
    Image,
    Platform,
    Alert,
    WebView,

} from 'react-native';

var dimensions = require('Dimensions');
var IMWindow = dimensions.get('window');

var IMSeller = React.createClass({

    // getDefaultProps方法
    getDefaultProps(){
        return{

        }
    },

    // getInitialState方法
    getInitialState(){
        return{

        }
    },

    // render方法
    render(){
        return(
            <View style={styles.container}>
                <WebView style={styles.mainWebView}
                         automaticallyAdjustContentInsets={false}
                         javaScriptEnabled={true}
                         domStorageEnabled={true}
                         decelerationRate="normal"
                         onNavigationStateChange={this.onNavigationStateChange}
                         onShouldStartLoadWithRequest={this.onShouldStartLoadWithRequest}
                         startInLoadingState={true}
                         scalesPageToFit={this.state.scalesPageToFit}
                         source={{uri:"http://i.meituan.com/brunch/around?uuid=EF3058D6C94CA199CF744483D94D97850CBE31C2B20F1FAA1EC9FAAF494032B1&utm_term=7.6.0&utm_source=AppStore&utm_content=EF3058D6C94CA199CF744483D94D97850CBE31C2B20F1FAA1EC9FAAF494032B1&rn_package_version=0&version_name=7.6.0&utm_medium=iphone&chosenPosition=31.093200%2C121.227677&lat=31.091116&utm_campaign=AgroupBgroupGmerchantH0&regionid=&lng=121.232099&f=iphone&js_patch_version=16&ci=10&msid=9D954F5B-FD34-4763-936A-947ADE93DA482016-12-12-15-30824"}}

                />

            </View>
        )
    },

    // componentDidMount方法,在这里直接放置需要的方法即可
    componentDidMount(){

    },

    //之后就是自定义的方法
});

const styles = StyleSheet.create({
    container:{
        flex:1,
        // justifyContent:'center',
        alignItems:'center',
        backgroundColor: 'blue',
    },
    mainWebView:{
        backgroundColor: 'white',
        width: IMWindow.width,
        height:IMWindow.height,

    },
});

module.exports = IMSeller;