Creating an Array of unknown type

前端 未结 3 1030
北恋
北恋 2021-01-05 15:33

I have an object which I must validate values off the problem, some of the attributes of the Objects are arrays of custom objects. Such that it will involve some boring down

3条回答
  •  天涯浪人
    2021-01-05 16:34

    No, you cannot use a variable (repeatingGrp) as a type.

    There are ways to do "dynamic" casting, but these wouldn't help you. The return type of getAttribArray is Object, which would defeat the point of casting to a particular type.

    And even if you could fix that, it's still not clear what you could do with this mechanism. What do you want to be able to do with the result of getAttribArray()?

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题