Closed davejbur closed 4 years ago
Yes, you are right withTagSize step requires an enumerated value.
If you are still unable to resolve this issue, let me know, that next weekend I will see a solution for you.
Thanks - yes, it would be good to get a fix for this.
At present I'm using a workaround which is OK for me - I've modified your ParseGIAI by adding public setIndividualAssetReference & getIndividualAssetReference methods, then:
''' ParseGIAI parserTagMaster = ParseGIAI.Builder().withEPCTagURI(aTagUri ).build(); parserTagMaster.setIndividualAssetReference("9"+giaiSeen.getIndividualAssetReference().substring(1)); '''
But having a method for getting from a string to an enumerated tagsize would be much easier and more obvious:-)
Thanks!
hi, try this way:
.withTagSize( GIAITagSize.forCode(Integer.parseInt(giaiSeen.getTagSize())) )
logically this can be done to:
.withFilterValue( GIAIFilterValue.forCode(Integer.parseInt(giaiSeen.getFilterValue())) )
Great! - thank you very much for that, I missed the forCode method, I thought there must be some way of doing it but couldn't work it out. Thanks again for you help and the time you took.
Hi, this is a really useful library, many thanks! (Have you thought about getting it on Maven?)
Anyway, I'm having a problem where I've got a tag URI, and I want to build another one based on the information in the first one (replacing the first digit in the individual asset reference).
I've therefore got:
Note the withTagSize step requires an enumerated value, not a string.
However, I then get the error:
I imagine this is because valueOf isn't implemented for the enumerated type? Can it be? Or is there another/better way of getting from a string to a GIAITagSize?
(An alternative method is to add a get/set to ParseGIAI for individualAssetReference - this makes it possible to build the new tag using withEPCTagURI and the original uri, then setIndividualAssetReference on that. But that seems to be a long-winded way of doing it...)
(edit) Or, I suppose, creating a GIAI#getGiaiTagSize method that returns a GIAITagSize?