Answer the length of a list field
@param fieldName
@return
171640
public int getListFieldLength(String fieldName) {
		int ret = -1;
		Object val = getFieldValue(fieldName, true); // internal
		if (val instanceof List<?>)
			ret = ((List<?>)val).size();
		else if (val != null && val.getClass().isArray()) {
			ret = Array.getLength(val);
		} else {
			if (!getDomainObjectType().getFieldByName(fieldName).isListOrArray())
				throw new RuntimeException("field: [" + fieldName + "] is neither list nor array");
			if (val == null)
				throw new RuntimeException("list or array field: [" + fieldName + "] is null");
		}
		return ret;
	}
980548
private int getDynamicFieldSize(Object obj, Charset charset)
            throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
        int size = 0;
        for (FieldMetaData field : dynamicFieldList) {
            size = size + field.getDynamicFieldByteSize(obj, charset);
        }
        return size;
    }
139063
def field2length(self, field, **kwargs):
        
        attributes = {}

        validators = [
            validator
            for validator in field.validators
            if (
                hasattr(validator, "min")
                and hasattr(validator, "max")
                and hasattr(validator, "equal")
            )
        ]

        is_array = isinstance(
            field, (marshmallow.fields.Nested, marshmallow.fields.List)
        )
        min_attr = "minItems" if is_array else "minLength"
        max_attr = "maxItems" if is_array else "maxLength"

        for validator in validators:
            if validator.min is not None:
                if hasattr(attributes, min_attr):
                    attributes[min_attr] = max(attributes[min_attr], validator.min)
                else:
                    attributes[min_attr] = validator.min
            if validator.max is not None:
                if hasattr(attributes, max_attr):
                    attributes[max_attr] = min(attributes[max_attr], validator.max)
                else:
                    attributes[max_attr] = validator.max

        for validator in validators:
            if validator.equal is not None:
                attributes[min_attr] = validator.equal
                attributes[max_attr] = validator.equal
        return attributes
967058
public int getFieldsSendTotalByteSize(Object bean, Charset charset) {
        if (!hasDynamicField()) {
            return fieldsTotalSize;
        } else {
            return getDynamicTotalFieldSize(bean, charset);
        }
    }
842435
final String shortName() {
    if (fieldDescriptor().isPresent()) {
      return fieldDescriptor().get().isExtension()
          ? "[" + fieldDescriptor().get() + "]"
          : fieldDescriptor().get().getName();
    } else {
      return String.valueOf(unknownFieldDescriptor().get().fieldNumber());
    }
  }
359316
function(field, length) {
    if (Array.isArray(field)) {
      return this.validateFieldsHelper(field, [length], this.validatesLengthOf)
    }

    return this.validates(field, function() {
      var valid = true
      if (this[field]) valid = this[field].length <= length
      if (!valid)
        this.errors.add(field, 'maximum length of ' + length + ' exceeded')
      return valid
    })
  }
1342007
public JavaField getField(String name)
  {
    ArrayList<JavaField> fieldList = getFieldList();
    
    for (int i = 0; i < fieldList.size(); i++) {
      JavaField field = fieldList.get(i);

      if (field.getName().equals(name))
        return field;
    }

    return null;
  }
1150172
def sizeof(self, fields):
        

        if type(fields) in [tuple, list]:
            str = ','.join(fields)
        else:
            str = fields
        n = _C.VSsizeof(self._id, str)
        _checkErr('sizeof', n, "cannot retrieve field sizes")
        return n
598198
public static int optionLength(String option) {
	int result = Standard.optionLength(option);
	if (result != 0)
	    return result;
	else
	    return UmlGraph.optionLength(option);
    }
50528
public int length() {
        if (tc.isEntryEnabled())
            SibTr.entry(tc, "length");
        if (tc.isDebugEnabled())
            SibTr.debug(tc, "rc=", elements);
        if (tc.isEntryEnabled())
            SibTr.exit(tc, "length");

        return elements;
    }
115197
public long length() {
        return doWithJedis(new JedisCallable<Long>() {
            @Override
            public Long call(Jedis jedis) {
                return jedis.exists(getKey()) ? jedis.hlen(getKey()) : 0;
            }
        });
    }
613973
private void ensureLength(FieldDescriptorDef fieldDef, String checkLevel)
    {
        if (!fieldDef.hasProperty(PropertyHelper.OJB_PROPERTY_LENGTH))
        {
            String defaultLength = JdbcTypeHelper.getDefaultLengthFor(fieldDef.getProperty(PropertyHelper.OJB_PROPERTY_JDBC_TYPE));

            if (defaultLength != null)
            {
                LogHelper.warn(true,
                               FieldDescriptorConstraints.class,
                               "ensureLength",
                               "The field "+fieldDef.getName()+" in class "+fieldDef.getOwner().getName()+" has no length setting though its jdbc type requires it (in most databases); using default length of "+defaultLength);
                fieldDef.setProperty(PropertyHelper.OJB_PROPERTY_LENGTH, defaultLength);
            }
        }
    }
1049492
public String getString(String fieldName) {
		return hasValue(fieldName) ? String.valueOf(resultMap.get(fieldName)) : null;
	}
630267
@Override
    int guessApproxLength() {
        int total = super.guessApproxLength();
        int size = 0;
        List props;

        // Assume 40 bytes per property (string name + value)
        // Each property map may be cached in a transient, or in the base JMF (or both!)
        // If there are no properties, the names may be represented by the EMPTY
        // JMF List, in which case we do NOT want to actually get them.
        // The property will only be flattened 'once' so only count it once.
        if (jmsUserPropertyMap != null) {
            size += jmsUserPropertyMap.size();
        }
        else {
            if (getApi().isNotEMPTYlist(JsApiAccess.JMSPROPERTY_NAME)) {
                props = (List) getApi().getField(JsApiAccess.JMSPROPERTY_NAME);
                if (props != null) {
                    size += props.size();
                }
            }
        }

        if (otherUserPropertyMap != null) {
            size += otherUserPropertyMap.size();
        }
        else {
            if (getApi().isNotEMPTYlist(JsApiAccess.OTHERPROPERTY_NAME)) {
                props = (List) getApi().getField(JsApiAccess.OTHERPROPERTY_NAME);
                if (props != null) {
                    size += props.size();
                }
            }
        }

        if (jmsSystemPropertyMap != null) {
            size += jmsSystemPropertyMap.size();
        }
        else {
            if (getApi().isNotEMPTYlist(JsApiAccess.SYSTEMPROPERTY_NAME)) {
                props = (List) getApi().getField(JsApiAccess.SYSTEMPROPERTY_NAME);
                if (props != null) {
                    size += props.size();
                }
            }
        }

        if (systemContextMap != null) {
            size += systemContextMap.size();
        }
        else {
            if (getApi().isNotEMPTYlist(JsApiAccess.SYSTEMCONTEXT_NAME)) {
                props = (List) getApi().getField(JsApiAccess.SYSTEMCONTEXT_NAME);
                if (props != null) {
                    size += props.size();
                }
            }
        }

        if (mqMdSetPropertiesMap != null) {
            size += mqMdSetPropertiesMap.size();
        }
        else {
            // This field usually doesn't exist, so no need for the isNotEMPTY check
            props = (List) getHdr2().getField(JsHdr2Access.MQMDPROPERTIES_MAP_NAME);
            if (props != null) {
                size += props.size();
            }
        }

        total += size * 40;
        return total;
    }
552919
public DOField getFieldByName(String fieldName) {
		int idx = this.getIndexOfField(fieldName);
		if (idx != -1)
			return this.getFieldByIndex(idx);
		return null;
	}
206624
public static Single<Long> length(CacheConfigBean cacheConfigBean, String cacheKey) {
        return SingleRxXian.call(CacheService.CACHE_SERVICE, "cacheListLength", new JSONObject() {{
            put("cacheConfig", cacheConfigBean);
            put("key", cacheKey);
        }}).map(unitResponse -> {
            long length = Objects.requireNonNull(unitResponse.dataToLong());
            return length > 0 ? length : 0;
        });
    }
1231130
public JcNumber length() {
		JcNumber ret = new JcNumber(null, this,
				new FunctionInstance(FUNCTION.Collection.LENGTH, 1));
		QueryRecorder.recordInvocationConditional(this, "length", ret);
		return ret;
	}