package net.pterodactylus.fcp;
+
/**
* The “PersistentGet” message is sent to the client to inform it about a
* persistent download, either in the client-local queue or in the global queue.
* @return The priority of the request
*/
public Priority getPriority() {
- return Priority.values()[FcpUtils.safeParseInt(getField("PriorityClass"), 7)];
+ return Priority.values()[FcpUtils.safeParseInt(getField("PriorityClass"), Priority.unknown.ordinal())];
}
/**
* priority could not be parsed
*/
public Priority getPriority() {
- try {
- return Priority.values()[Integer.valueOf(getField("PriorityClass"))];
- } catch (NumberFormatException nfe1) {
- return Priority.unknown;
- }
+ return Priority.values()[FcpUtils.safeParseInt(getField("PriorityClass"), Priority.unknown.ordinal())];
}
/**
* @return The priority of the request
*/
public Priority getPriority() {
- return Priority.valueOf(getField("PriorityClass"));
+ return Priority.values()[FcpUtils.safeParseInt(getField("PriorityClass"), Priority.unknown.ordinal())];
}
/**