Resolves all field schemas.

@param fields All the fields that need to be resolved.
@return A {@link java.util.Map} which has all the field schemas resolved.
@see #resolveSchema(Schema, java.util.Map)
329166
private Map<String, Field> populateRecordFields(Map<String, Field> fields) {
    if (fields == null) {
      return null;
    }

    Map<String, Schema> knownRecordSchemas = Maps.newHashMap();
    knownRecordSchemas.put(recordName, this);
    ImmutableMap.Builder<String, Field> builder = ImmutableMap.builder();

    for (Map.Entry<String, Field> fieldEntry : fields.entrySet()) {
      String fieldName = fieldEntry.getKey();
      Field field = fieldEntry.getValue();
      Schema fieldSchema = resolveSchema(field.getSchema(), knownRecordSchemas);

      if (fieldSchema == field.getSchema()) {
        builder.put(fieldName, field);
      } else {
        builder.put(fieldName, Field.of(fieldName, fieldSchema));
      }
    }

    return builder.build();
  }
30076
private Object resolveReferenceValueOfField(FieldData field) {
        Object value = null;
        // Regardless of its path, the field references another resource.
        // fetch the field value (the path(s) to the referenced resource(s)) and resolve these resources.
        if (field.metaData.isCollectionType()) {
            String[] referencedResourcePaths = resolvePropertyTypedValue(field, String[].class);
            if (referencedResourcePaths != null) {
                value = createCollectionOfReferences(field, referencedResourcePaths);
            }
        } else {
            String referencedResourcePath = resolvePropertyTypedValue(field, String.class);
            if (referencedResourcePath != null) {
                if (field.metaData.isAppendPathPresentOnReference()) {
                    referencedResourcePath += field.metaData.getAppendPathOnReference();
                }
                value = resolveResource(referencedResourcePath, field.metaData.getType());
            }
        }
        return value;
    }
111704
private TableFieldSchema parseFieldAnnotations(Field field) {
    TableFieldSchema tf = new TableFieldSchema();
    String name = getFieldName(field);
    String desc = getFieldDescription(field);
    String fieldMode = getFieldMode(field);

    return tf.setName(name).setDescription(desc).setMode(fieldMode);
  }
907716
public CMAEntry setFields(LinkedHashMap<String, LinkedHashMap<String, Object>> fields) {
    this.fields = fields;
    return this;
  }
232240
def _resolve_definitions(self, schema, definitions):
        
        if not definitions:
            return schema

        if not isinstance(schema, dict):
            return schema

        ref = schema.pop('$ref', None)
        if ref:
            path = ref.split('/')[2:]
            definition = definitions
            for component in path:
                definition = definitions[component]

            if definition:
                # Only update specified fields
                for (key, val) in six.iteritems(definition):
                    if key not in schema:
                        schema[key] = val

        for key in six.iterkeys(schema):
            schema[key] = self._resolve_definitions(schema[key], definitions)

        return schema
805495
def _get_mapping(self, schema):
        
        properties = {}
        for field, field_schema in schema.items():
            field_mapping = self._get_field_mapping(field_schema)
            if field_mapping:
                properties[field] = field_mapping
        return {'properties': properties}
1298679
public static List<JBBPAbstractField> fieldsAsList(final JBBPAbstractField... fields) {
    final List<JBBPAbstractField> result = new ArrayList<>();
    Collections.addAll(result, fields);
    return result;
  }
1164927
public void selectFields(String[] fieldNames) {
		checkNotNull(fieldNames, "fieldNames");
		this.fieldNames = fieldNames;
		RowTypeInfo rowTypeInfo = (RowTypeInfo) ParquetSchemaConverter.fromParquetType(expectedFileSchema);
		TypeInformation[] selectFieldTypes = new TypeInformation[fieldNames.length];
		for (int i = 0; i < fieldNames.length; i++) {
			try {
				selectFieldTypes[i] = rowTypeInfo.getTypeAt(fieldNames[i]);
			} catch (IndexOutOfBoundsException e) {
				throw new IllegalArgumentException(String.format("Fail to access Field %s , "
						+ "which is not contained in the file schema", fieldNames[i]), e);
			}
		}
		this.fieldTypes = selectFieldTypes;
	}
17601
public FieldSchema getField(String name) {
    for (FieldSchema field : fieldSchemas)
      if (field.getName().equals(name))
        return field;
    return null;
  }
1357443
public List<org.apache.lucene.search.SortField> sortFields(Schema schema) {
        return sort.stream().map(s -> s.sortField(schema)).collect(Collectors.toList());
    }
1034129
public static Optional<Class> resolveGenericTypeArgument(Field field) {
        Type genericType = field != null ? field.getGenericType() : null;
        if (genericType instanceof ParameterizedType) {
            Type[] typeArguments = ((ParameterizedType) genericType).getActualTypeArguments();
            if (typeArguments.length > 0) {
                Type typeArg = typeArguments[0];
                return resolveParameterizedTypeArgument(typeArg);
            }
        }
        return Optional.empty();
    }
932712
public void addAll(Schema sch) {
		fields.putAll(sch.fields);
		if (myFieldSet != null)
			myFieldSet = new TreeSet<String>(fields.keySet());
	}
1121488
public org.apache.lucene.search.SortField sortField(Schema schema) {
        if (field == null || field.trim().isEmpty()) {
            throw new IllegalArgumentException("Field name required");
        }
        ColumnMapper columnMapper = schema.getMapper(field);
        if (columnMapper == null) {
            throw new IllegalArgumentException("No mapper found for sortFields field " + field);
        } else {
            return columnMapper.sortField(field, reverse);
        }
    }
1025467
public static void resolve(Map<String, String> properties) {
		boolean resolved = true;
		while (resolved) {
			resolved = false;
			for (Map.Entry<String, String> p : properties.entrySet()) {
				String v = p.getValue();
				if (v == null) continue;
				int i = v.indexOf("${");
				if (i < 0) continue;
				int j = v.indexOf('}', i + 2);
				if (j < 0) continue;
				String name = v.substring(i + 2, j);
				String val = properties.get(name);
				if (val == null) val = "";
				v = v.substring(0, i) + val + v.substring(j + 1);
				properties.put(p.getKey(), v);
				resolved = true;
				break;
			}
		}
	}
972334
protected <T extends AnnotatedElement> Map<T, PropertyInfo> resolve(String keyPrefix, T[] elements, Set<Class> resolvedConfigs) {
        Map<T, PropertyInfo> result = new HashMap<>();
        for (T element : elements) {
            try {
                result.putAll(resolveProperty(keyPrefix, element));
                result.putAll(resolveConfig(keyPrefix, element, resolvedConfigs));
            } catch (PropertyLoaderException e) {
                throw new PropertyLoaderException(String.format("Error while process %s", element), e);
            }
        }
        return result;
    }
493584
public Schema loadSchema(String schema) {
    try {
      JSONObject rawSchema = new JSONObject(new JSONTokener(schema));
      return SchemaLoader.load(rawSchema);
    } catch (JSONException | SchemaException e) {
      throw new InvalidJsonSchemaException(e);
    }
  }
830288
@GwtIncompatible("Class.getDeclaredFields")
	public ToStringBuilder addAllFields() {
		List<Field> fields = getAllDeclaredFields(instance.getClass());
		for(Field field : fields) {
			addField(field);
		}
		return this;
	}