Scans the array fields and returns any fields that are not static or (optionally) final.

@param fields            the fields to process
@param returnFinalFields include final fields in the results
@return the valid fields
774230
public static List<Field> getValidFields(final Field[] fields, final boolean returnFinalFields) {
        final List<Field> validFields = new ArrayList<Field>();
        // we ignore static and final fields
        for (final Field field : fields) {
            if (!Modifier.isStatic(field.getModifiers()) && (returnFinalFields || !Modifier.isFinal(field.getModifiers()))) {
                validFields.add(field);
            }
        }
        return validFields;
    }
55911
public GenericField[] getFields()
	{
		Collection<GenericField> values = fieldMap.values();
		
		if(values == null || values.isEmpty())
			return null;
		
		GenericField[] fieldMirrors = new GenericField[values.size()];
		
		values.toArray(fieldMirrors);
		
		return fieldMirrors;
	}
1263781
public static PrintFields parse(final String printFields) {
        Validate.notNull(printFields, "PrintFields must not be null");

        final Set<String> printFieldsSet = new LinkedHashSet<String>(Arrays.asList(SEPARATORS.split(printFields)));
        printFieldsSet.remove("");

        return new PrintFields(printFieldsSet);
    }
1322555
ObjectStreamField[] fields() {
        if (fields == null) {
            Class<?> forCl = forClass();
            if (forCl != null && isSerializable() && !forCl.isArray()) {
                buildFieldDescriptors(forCl.getDeclaredFields());
            } else {
                // Externalizables or arrays do not need FieldDesc info
                setFields(NO_FIELDS);
            }
        }
        return fields;
    }
1290763
public BoxResourceIterable<BoxCollaboration.Info> getAllFileCollaborations(String... fields) {
        return BoxCollaboration.getAllFileCollaborations(this.getAPI(), this.getID(),
                GET_COLLABORATORS_PAGE_SIZE, fields);

    }
43693
public static List<Field> getDeclaredFields(@NonNull Class<?> clazz, boolean recursive) {
      List<Field> fields = new ArrayList<>();
      do {
         fields.addAll(Arrays.asList(clazz.getDeclaredFields()));
         clazz = clazz.getSuperclass();
      } while (recursive && clazz != null && clazz != Object.class);
      return fields;
   }
211287
public static List<Field> getAllFields(Class<?> clas) {
		JK.fixMe("add caching..");
		List<Field> list = new Vector<>();
		// start by fields from the super class
		if (clas.getSuperclass() != null) {
			list.addAll(getAllFields(clas.getSuperclass()));
		}
		Field[] fields = clas.getDeclaredFields();
		for (Field field : fields) {
			if (!Modifier.isStatic(field.getModifiers())) {
				list.add(field);
			}
		}
		return list;
	}
1150845
public static List<Field> sortSuperTypesLast(Collection<? extends Field> unsortedFields) {
        List<Field> fields = new ArrayList<Field>(unsortedFields);

        Collections.sort(fields, compareFieldsByName);

        int i = 0;

        while (i < fields.size() - 1) {
            Field f = fields.get(i);
            Class<?> ft = f.getType();
            int newPos = i;
            for (int j = i + 1; j < fields.size(); j++) {
                Class<?> t = fields.get(j).getType();

                if (ft != t && ft.isAssignableFrom(t)) {
                    newPos = j;
                }
            }

            if (newPos == i) {
                i++;
            } else {
                fields.remove(i);
                fields.add(newPos, f);
            }
        }

        return fields;
    }
543397
public AggregationResult aggregate(String fields) throws DDFException {
    return this.getAggregationHandler().aggregate(AggregateField.fromSqlFieldSpecs(fields));
  }
718785
public Set<String> getReturnFields() {

        if (m_fieldAdded) {
            for (CmsSearchField field : getLuceneFields()) {
                if (field.isStored() && !LAZY_FIELDS.contains(field.getName())) {
                    m_returnFields.add(field.getName());
                }
            }
        }
        m_fieldAdded = false;
        return m_returnFields;
    }
69171
public void readFields(ArrayList<String> fields) throws IOException {
		fields.clear();
		if (this.eof) {
			throw new EOFException();
		}
		do {
			fields.add(readField());
		} while (this.moreFieldsOnLine);
	}
1119884
public void checkFieldsCompatible(final String... fields) {
        final Set<String> indexFields = Sets.newHashSet(index.getDefinition().getFields());
        final Joiner joiner = Joiner.on(",");
        check(indexFields.equals(Sets.newHashSet(fields)),
                "Existing index '%s' (class '%s') fields '%s' are different from '%s'.",
                index.getName(), index.getDefinition().getClassName(), joiner.join(indexFields), joiner.join(fields));
    }
1333071
public function returnedFields($fields) {
		if(empty($this->data['returnedFields'])) {
			$this->data['returnedFields'] = array();
		}
		$this->data['returnedFields'] = array_unique(array_merge($this->data['returnedFields'], (array)$fields));
		return $this;
	}
963194
void setFields(Field[] fields) {
    this.fields = fields;
    this.resultSetColumnNameIndexMap = null;
    this.cachedMaxResultRowSize = null;
    this.needUpdateFieldFormats = fields != null;
    this.hasBinaryFields = false; // just in case
  }
879152
public Iterable<BoxLegalHoldAssignment.Info> getAssignments(String ... fields) {
        return this.getAssignments(null, null, DEFAULT_LIMIT, fields);
    }
890897
private static List<Field> findFields() {
        List<Field> result = new ArrayList<Field>();
        for (Field f : LoadStatistics.class.getFields()) {
            if (Modifier.isPublic(f.getModifiers()) && MultiStageTimeSeries.class.isAssignableFrom(f.getType())
                    && f.getAnnotation(Deprecated.class) == null) {
                result.add(f);
            }
        }
        return result;
    }
592066
public function fields(array $fields = null) {
        if ($fields === null) {
            return $this->fields;
        }

        $this->fields = $fields;

        return $this;
    }