Attributekeys are depreciated and cause problems with my code. I looked on the netty wiki and it said I should "Use valueOf(String) instead." umm, I don't see how finding the value of a string has anything to do with attribute keys. Anyone have some explanations on this?
They changed the AttributeKeys at some point. They are still there though:
The old way of creating the keys:
final static AttributeKey<Long> CHECKSUMKEY = new AttributeKey("calcchecksum");
was replaced with this:
final static AttributeKey<Long> CHECKSUMKEY = AttributeKey.valueOf("calcchecksum");
final static AttributeKey<CustomClass> COMMANDKEY = AttributeKey.valueOf("command");
final static AttributeKey<Long> FILEHANDLEKEY = AttributeKey.valueOf("filehandle");
final static AttributeKey<File> PATHKEY = AttributeKey.valueOf("destpath");
So only the constructor of AttributeKey is deprecated. You can the use them like this for example:
ctx.channel().attr(Server.PATHKEY).set(file);
File file = ctx.channel().attr(Server.PATHKEY).get();
ctx.channel().attr(Server.PATHKEY).remove();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With