protected final void verifyFieldType(short id, String name, Collection<FieldMetadata> fields, ThriftCatalog catalog)
    {
        boolean isSupportedType = true;
        for (FieldMetadata field : fields) {
            if (!catalog.isSupportedStructFieldType(field.getJavaType())) {
                metadataErrors.addError("Thrift class '%s' field '%s(%s)' type '%s' is not a supported Java type", structName, name, id, TypeToken.of(field.getJavaType()));
                isSupportedType = false;
                // only report the error once
                break;
            }
        }

        // fields must have the same type
        if (isSupportedType) {
            Set<ThriftTypeReference> types = new HashSet<>();
            for (FieldMetadata field : fields) {
                types.add(catalog.getFieldThriftTypeReference(field));
            }
            if (types.size() > 1) {
                metadataErrors.addError("Thrift class '%s' field '%s(%s)' has multiple types: %s", structName, name, id, types);
            }
        }
    }
protected final void verifyFieldType ( short id , String name , Collection < FieldMetadata > fields , ThriftCatalog catalog ) { boolean isSupportedType = true ; for ( FieldMetadata field : fields ) { if ( ! catalog . isSupportedStructFieldType ( field . getJavaType ( ) ) ) { metadataErrors . addError ( "Thrift class '%s' field '%s(%s)' type '%s' is not a supported Java type" , structName , name , id , TypeToken . of ( field . getJavaType ( ) ) ) ; isSupportedType = false ; break ; } } if ( isSupportedType ) { Set < ThriftTypeReference > types = new HashSet < > ( ) ; for ( FieldMetadata field : fields ) { types . add ( catalog . getFieldThriftTypeReference ( field ) ) ; } if ( types . size ( ) > 1 ) { metadataErrors . addError ( "Thrift class '%s' field '%s(%s)' has multiple types: %s" , structName , name , id , types ) ; } } }
Verifies that the the fields all have a supported Java type and that all fields map to the
exact same ThriftType.