Java 如何将字段重写为';空';在spring yml文件中

Java 如何将字段重写为';空';在spring yml文件中,java,spring,spring-boot,yaml,Java,Spring,Spring Boot,Yaml,我有一个包含以下内容的yml文件 FirstQueueType: &QueueType1 prop1: true SecondQueueType: &QueueType2 prop1: false BaseQueue: &BaseQueue name: abc type: <<: *QueueType1 CategoryQueue: &CategoryQueue <<: *BaseQ

我有一个包含以下内容的yml文件

FirstQueueType: &QueueType1
    prop1: true
SecondQueueType: &QueueType2
    prop1: false

BaseQueue: &BaseQueue
    name: abc
    type:
       <<: *QueueType1

CategoryQueue: &CategoryQueue
    <<: *BaseQueue
    type: ~
    name: xyz
我得到以下错误

java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [abc.QueueType] for property 'type': no matching editors or conversion strategy found]
继承时如何将父类中属性的值重置为null(在本例中,将CategoryQueue的“type”属性设置为null)

我试过了

  • 空的
  • ~
java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [abc.QueueType] for property 'type': no matching editors or conversion strategy found]