get error message info by type not matched.

@param type the type
@param field the field
@return error message for mismatch type
554384
private String getMismatchTypeErroMessage(FieldType type, Field field) {
        return "Type mismatch. @Protobuf required type '" + type.getJavaType() + "' but field type is '"
                + field.getType().getSimpleName() + "' of field name '" + field.getName() + "' on class "
                + field.getDeclaringClass().getCanonicalName();
    }
510482
protected JsonObjectBase buildParamError(String field, String message, ErrorCode errorCode) {
        Map<String, String> map = new HashMap<String, String>();
        map.put(field, message);
        if (errorCode == null) {
            return JsonObjectUtils.buildFieldError(map, ErrorCode.FIELD_ERROR);
        }
        return JsonObjectUtils.buildFieldError(map, errorCode);
    }
431998
public void checkMismatchedValidatorAnnotation(Field field, Map<String, Class<?>> genericMap) {
        doCheckMismatchedValidatorAnnotation(field, genericMap);
    }
359756
public static <T extends FieldDescription> ElementMatcher.Junction<T> fieldType(TypeDescription fieldType) {
        return fieldType(is(fieldType));
    }
911592
private static String getTypeName(FieldElement field) {
        DataType type = field.type();
        return type.toString();
    }
187871
@SuppressWarnings("unchecked")
	public static <T> T getValueOf(Field field, Object reference, Class<?> referenceClazz, Class<T> valueType) {
		try {
			field.setAccessible(true);
			Object toReturn = (T) field.get(reference);
			if (String.class.isInstance(valueType.getClass()) && !String.class.isInstance(toReturn.getClass())) {
				toReturn = toReturn.toString();
			}
			return (T) toReturn;
		} catch (Exception e) {
			log.warning(e.getClass().getSimpleName() + ": " + e.getMessage());
			return null;
		}
	}
16084
public void error(final CellField<T> cellField) {
        ArgUtils.notNull(cellField, "cellField");
        error(cellField, getMessageKey(), getMessageVariables(cellField));
    }
15075
def invalid_return_type_error(
    return_type: GraphQLObjectType, result: Any, field_nodes: List[FieldNode]
) -> GraphQLError:
    """"""
    return GraphQLError(
        f"Expected value of type '{return_type.name}' but got: {inspect(result)}.",
        field_nodes,
    )
1097029
public ByteBuffer getValue(String field) throws IOException {
        int hash = Arrays.hashCode(field.getBytes());
        return getValue(structure.valueHash2Index.get(hash));
    }
305164
def config_field_type(field, cls):
    
    return defs.ConfigField(lambda _: isinstance(_, cls),
                            lambda: CONFIG_FIELD_TYPE_ERROR.format(field, cls.__name__))
613848
public static Class<?> getParameterTypeOfRepeatedField(Field field) {
    Class<?> componentType = null;
    if (isCollection(field.getType())) {
      validateCollection(field);
      Type parameterType = getParameterType((ParameterizedType) field.getGenericType());
      validateNestedParameterizedType(parameterType);
      componentType = (Class<?>) parameterType;
    } else if (field.getType().isArray()) {
      componentType = field.getType().getComponentType();
      return componentType;
    } else {
      throw new IllegalArgumentException("Unsupported repeated type " + field.getType()
          + " Allowed repeated fields are Collection<T> and arrays");
    }
    validateNestedRepeatedType(componentType, field);
    return componentType;
  }
512216
public void updateField(Field field) {
        this.name = field.getName();
        this.obj = TypeCheckUtil.isObjClass(field);
        this.list = TypeCheckUtil.isListClass(field);
        this.number = TypeCheckUtil.isNumberClass(field);
        this.enumType = field.getType().isEnum();
        this.typeClass = field.getType();
        this.type = field.getType().getSimpleName();

        if (this.list) {
            this.innerClass = ValidationObjUtil.getListInnerClassFromGenericType(field.getGenericType());
            this.type += "<" + this.innerClass.getSimpleName() + ">";
        }
    }
747679
public InternalFieldErrorBuilder createFieldError(final String field, final String errorCode) {
        
        return createFieldError(field, new String[]{errorCode});
        
    }
850394
public Class<?> getFieldType(final String field) {
        
        final String fieldPath = buildFieldPath(field);
        Class<?> type = propertyTypeNavigator.getPropertyType(target.getClass(), fieldPath);
        if(type != null) {
            return type;
        }
        
        return getActualFieldType(fieldPath);
    }
224245
function getError(field, value) {
	// Check we actually got a string
	if (typeof value !== "string") {
		return errorInvalidParams(field + " must be a string");
	}
	// Check value is not empty
	if (!value.trim()) {
		return errorInvalidParams(field + " must not be empty");
	}
}
725468
@SuppressWarnings("unchecked")
	public void addErrors(String field, List<String> errors) {
		Assert.notNull(field, "field must not be null");
		Assert.notNull(errors, "field must not be null");

		// do not overwrite existing errors
		Map<String, List<String>> errorMap = (Map<String, List<String>>) this.result
				.get(ERRORS_PROPERTY);
		if (errorMap == null) {
			errorMap = new HashMap<>();
			addResultProperty(ERRORS_PROPERTY, errorMap);
		}

		List<String> fieldErrors = errorMap.get(field);
		if (fieldErrors == null) {
			fieldErrors = new ArrayList<>();
			errorMap.put(field, fieldErrors);
		}
		fieldErrors.addAll(errors);

		addResultProperty(SUCCESS_PROPERTY, Boolean.FALSE);
	}
775167
@Deprecated
    protected Class<?> getGenericRole(Field field)
    {
        Type type = field.getGenericType();

        if (type instanceof ParameterizedType) {
            ParameterizedType pType = (ParameterizedType) type;
            Type[] types = pType.getActualTypeArguments();
            if (types.length > 0 && types[types.length - 1] instanceof Class) {
                return (Class) types[types.length - 1];
            }
        }

        return null;
    }