[SOLVED]EntrySet is not supported by Example

wujiang
wujiang New Altair Community Member
edited November 5 in Community Q&A
Hi there

I have a project for add a operator to RM, Recently, I use the iterator for deal with 'example'. like:

 


public Reader(Example example) {
this.example = example.entrySet().iterator();
}
but once I execute my operator, a report of bug will be shown:

SEVERE: Process failed: operator cannot be executed (EntrySet is not supported by Example.). Check the log messages...
java.lang.UnsupportedOperationException: EntrySet is not supported by Example.

but, example is a type of Map<String, Object> ?

Could you help me?

Thanks a lot.

Jiang

Answers

  • Marco_Boeck
    Marco_Boeck New Altair Community Member
    Hi,

    as you can see in the Example.java class, not every operation from the parent class is supported. You can iterate over all values from an example via

    for (Attribute att : example.getAttributes()) {
        System.out.println(example.getValue(att));
    }
    Regards,
    Marco
  • wujiang
    wujiang New Altair Community Member
    OK, Got it, Thank you very much! ;D