Returns true if fieldDescriptor holds a sanitized proto type.
184016
public static boolean isSanitizedContentField(FieldDescriptor fieldDescriptor) {
    return fieldDescriptor.getType() == Type.MESSAGE
        && SAFE_PROTO_TYPES.contains(fieldDescriptor.getMessageType().getFullName());
  }
780252
public boolean isSet(_Fields field) {
    if (field == null) {
      throw new IllegalArgumentException();
    }

    switch (field) {
    case KEYSPACE:
      return isSetKeyspace();
    case NAME:
      return isSetName();
    case COLUMN_TYPE:
      return isSetColumn_type();
    case COMPARATOR_TYPE:
      return isSetComparator_type();
    case SUBCOMPARATOR_TYPE:
      return isSetSubcomparator_type();
    case COMMENT:
      return isSetComment();
    case READ_REPAIR_CHANCE:
      return isSetRead_repair_chance();
    case COLUMN_METADATA:
      return isSetColumn_metadata();
    case GC_GRACE_SECONDS:
      return isSetGc_grace_seconds();
    case DEFAULT_VALIDATION_CLASS:
      return isSetDefault_validation_class();
    case ID:
      return isSetId();
    case MIN_COMPACTION_THRESHOLD:
      return isSetMin_compaction_threshold();
    case MAX_COMPACTION_THRESHOLD:
      return isSetMax_compaction_threshold();
    case KEY_VALIDATION_CLASS:
      return isSetKey_validation_class();
    case KEY_ALIAS:
      return isSetKey_alias();
    case COMPACTION_STRATEGY:
      return isSetCompaction_strategy();
    case COMPACTION_STRATEGY_OPTIONS:
      return isSetCompaction_strategy_options();
    case COMPRESSION_OPTIONS:
      return isSetCompression_options();
    case BLOOM_FILTER_FP_CHANCE:
      return isSetBloom_filter_fp_chance();
    case CACHING:
      return isSetCaching();
    case DCLOCAL_READ_REPAIR_CHANCE:
      return isSetDclocal_read_repair_chance();
    case MEMTABLE_FLUSH_PERIOD_IN_MS:
      return isSetMemtable_flush_period_in_ms();
    case DEFAULT_TIME_TO_LIVE:
      return isSetDefault_time_to_live();
    case SPECULATIVE_RETRY:
      return isSetSpeculative_retry();
    case TRIGGERS:
      return isSetTriggers();
    case CELLS_PER_ROW_TO_CACHE:
      return isSetCells_per_row_to_cache();
    case MIN_INDEX_INTERVAL:
      return isSetMin_index_interval();
    case MAX_INDEX_INTERVAL:
      return isSetMax_index_interval();
    case ROW_CACHE_SIZE:
      return isSetRow_cache_size();
    case KEY_CACHE_SIZE:
      return isSetKey_cache_size();
    case ROW_CACHE_SAVE_PERIOD_IN_SECONDS:
      return isSetRow_cache_save_period_in_seconds();
    case KEY_CACHE_SAVE_PERIOD_IN_SECONDS:
      return isSetKey_cache_save_period_in_seconds();
    case MEMTABLE_FLUSH_AFTER_MINS:
      return isSetMemtable_flush_after_mins();
    case MEMTABLE_THROUGHPUT_IN_MB:
      return isSetMemtable_throughput_in_mb();
    case MEMTABLE_OPERATIONS_IN_MILLIONS:
      return isSetMemtable_operations_in_millions();
    case REPLICATE_ON_WRITE:
      return isSetReplicate_on_write();
    case MERGE_SHARDS_CHANCE:
      return isSetMerge_shards_chance();
    case ROW_CACHE_PROVIDER:
      return isSetRow_cache_provider();
    case ROW_CACHE_KEYS_TO_SAVE:
      return isSetRow_cache_keys_to_save();
    case POPULATE_IO_CACHE_ON_FLUSH:
      return isSetPopulate_io_cache_on_flush();
    case INDEX_INTERVAL:
      return isSetIndex_interval();
    }
    throw new IllegalStateException();
  }
723624
private void getDescriptor(final StringBuilder sb) {
        if (this.buf == null) {
            // descriptor is in byte 3 of 'off' for primitive types (buf ==
            // null)
            sb.append((char) ((off & 0xFF000000) >>> 24));
        } else if (sort == OBJECT) {
            sb.append('L');
            sb.append(this.buf, off, len);
            sb.append(';');
        } else { // sort == ARRAY || sort == METHOD
            sb.append(this.buf, off, len);
        }
    }
358519
def AddDescriptor(cls, field_desc):
    """"""
    if not isinstance(field_desc, ProtoType):
      raise type_info.TypeValueError(
          "%s field '%s' should be of type ProtoType" %
          (cls.__name__, field_desc.name))

    # Ensure the field descriptor knows the class that owns it.
    field_desc.SetOwner(cls)

    # If the field is late bound we do not really add it to the descriptor set
    # yet. We must wait for the LateBindingPlaceHolder() to add it later.
    if field_desc.late_bound:
      # Keep track of unbound fields.
      cls.late_bound_type_infos[field_desc.name] = field_desc
      return

    # Ensure this field number is unique:
    if field_desc.field_number in cls.type_infos_by_field_number:
      raise type_info.TypeValueError(
          "Field number %s for field %s is not unique in %s" %
          (field_desc.field_number, field_desc.name, cls.__name__))

    # We store an index of the type info by tag values to speed up parsing.
    cls.type_infos_by_field_number[field_desc.field_number] = field_desc
    cls.type_infos_by_encoded_tag[field_desc.encoded_tag] = field_desc

    cls.type_infos.Append(field_desc)
    cls.late_bound_type_infos.pop(field_desc.name, None)

    # Add direct accessors only if the class does not already have them.
    if not hasattr(cls, field_desc.name):
      # This lambda is a class method so pylint: disable=protected-access
      # This is much faster than __setattr__/__getattr__
      setattr(
          cls, field_desc.name,
          property(lambda self: self.Get(field_desc.name), lambda self, x: self.
                   _Set(x, field_desc), None, field_desc.description))
954617
public static void checkDescriptor(DatasetDescriptor descriptor) {
    Preconditions.checkNotNull(descriptor, "Descriptor cannot be null");

    Schema schema = descriptor.getSchema();
    checkSchema(schema);

    if (descriptor.isPartitioned()) {
      // marked as [BUG] because this is checked in DatasetDescriptor
      Preconditions.checkArgument(schema.getType() == Schema.Type.RECORD,
          "[BUG] Partitioned datasets must have record schemas");

      Set<String> names = Sets.newHashSet();
      for (Schema.Field field : schema.getFields()) {
        names.add(field.name());
      }

      List<String> incompatible = Lists.newArrayList();
      List<String> duplicates = Lists.newArrayList();
      for (FieldPartitioner fp : Accessor.getDefault().getFieldPartitioners(descriptor
          .getPartitionStrategy())) {
        String name = fp.getName();
        if (!isCompatibleName(name)) {
          incompatible.add(name);
        } else if (names.contains(name)) {
          duplicates.add(name);
        } else {
          names.add(name);
        }
      }
      ValidationException.check(incompatible.isEmpty(),
          "Partition names are not alphanumeric (plus '_'): %s",
          Joiner.on(", ").join(incompatible));
      ValidationException.check(duplicates.isEmpty(),
          "Partition names duplicate data fields: %s",
          Joiner.on(", ").join(duplicates));
    }
  }
779840
def _IsPresent(item):
  """"""

  if item[0].label == _FieldDescriptor.LABEL_REPEATED:
    return bool(item[1])
  elif item[0].cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:
    return item[1]._is_present_in_parent
  else:
    return True
704883
String descriptor(boolean includeThis) {
        StringBuilder result = new StringBuilder();
        result.append("(");
        if (includeThis) {
            result.append(declaringType.name);
        }
        for (TypeId t : parameters.types) {
            result.append(t.name);
        }
        result.append(")");
        result.append(returnType.name);
        return result.toString();
    }
193299
private boolean isPresentIn(String[] values, String field){
		for (String value : values)
			if(value.equalsIgnoreCase(JMapConversion.ALL) || value.equals(field))
				return true;
		
		return false;
	}
926872
private boolean isSetterForField(ExecutableElement setter, VariableElement field) {
    return setter.getParameters() != null
        && setter.getParameters().size() == 1
        && setter.getParameters().get(0).asType().equals(field.asType());
    // TODO inheritance? TypeUtils is applicable?
  }
927950
public boolean isSet(_Fields field) {
    if (field == null) {
      throw new IllegalArgumentException();
    }

    switch (field) {
    case TYPE:
      return isSetType();
    case TYPE_QUALIFIERS:
      return isSetTypeQualifiers();
    }
    throw new IllegalStateException();
  }
425814
function isValidTypeDescriptor(obj) {
  const validKeys = ['type', 'payload', 'meta'];

  if (!isPlainObject(obj)) {
    return false;
  }
  for (let key in obj) {
    if (!~validKeys.indexOf(key)) {
      return false;
    }
  }
  if (!('type' in obj)) {
    return false;
  } else if (typeof obj.type !== 'string' && typeof obj.type !== 'symbol') {
    return false;
  }

  return true;
}
624824
private static boolean areFieldsCompatible(String sourceField, TypeInformation<?> inType, String targetField,
			TypeInformation<?> outType, boolean throwException) {

		try {
			// get source type information
			TypeInformation<?> sourceType = getExpressionTypeInformation(sourceField, inType);
			// get target type information
			TypeInformation<?> targetType = getExpressionTypeInformation(targetField, outType);
			return sourceType.equals(targetType);
		} catch (InvalidFieldReferenceException e) {
			if (throwException) {
				throw e;
			} else {
				return false;
			}
		}
	}
971969
private static void validateIfAvroSchema(SerializerDefinition serializerDef) {
        if(serializerDef.getName().equals(AVRO_GENERIC_VERSIONED_TYPE_NAME)
           || serializerDef.getName().equals(AVRO_GENERIC_TYPE_NAME)) {
            SchemaEvolutionValidator.validateAllAvroSchemas(serializerDef);
            // check backwards compatibility if needed
            if(serializerDef.getName().equals(AVRO_GENERIC_VERSIONED_TYPE_NAME)) {
                SchemaEvolutionValidator.checkSchemaCompatibility(serializerDef);
            }
        }
    }
329680
boolean mark(ProtoMember protoMember) {
    if (protoMember == null) throw new NullPointerException("type == null");
    if (identifierSet.excludes(protoMember)) return false;
    return members.containsKey(protoMember.type())
        ? members.put(protoMember.type(), protoMember)
        : types.add(protoMember.type());
  }
162694
private static void fieldTypeSignature(Result sb, TypeMirror type) throws IOException
    {
        switch (type.getKind())
        {
            case DECLARED:
                classTypeSignature(sb, type);
                break;
            case TYPEVAR:
                typeVariableSignature(sb, (TypeVariable)type);
                break;
            case ARRAY:
                arrayTypeSignature(sb, (ArrayType)type);
                break;
            default:
                //throw new UnsupportedOperationException(type.getKind()+" unsupported");
        }
    }
939593
def has_documented_type_or_fields(self, include_inherited_fields=False):
        
        if self.doc:
            return True
        else:
            return self.has_documented_fields(include_inherited_fields)
1008601
public static String descriptor(Type type, Types types) {
    SigGen sig = new SigGen(types);
    sig.assembleSig(types.erasure(type));
    return sig.toString();
  }