* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.netconf.mapping.api;
+package org.opendaylight.netconf.server.api.operations;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkState;
import java.util.Optional;
public final class HandlingPriority implements Comparable<HandlingPriority> {
-
public static final HandlingPriority CANNOT_HANDLE = new HandlingPriority();
public static final HandlingPriority HANDLE_WITH_DEFAULT_PRIORITY = new HandlingPriority(Integer.MIN_VALUE);
public static final HandlingPriority HANDLE_WITH_MAX_PRIORITY = new HandlingPriority(Integer.MAX_VALUE);
}
public boolean isCannotHandle() {
- return this.equals(CANNOT_HANDLE);
+ return equals(CANNOT_HANDLE);
}
@Override
@Override
public boolean equals(final Object obj) {
- if (this == obj) {
- return true;
- }
- if (!(obj instanceof HandlingPriority)) {
- return false;
- }
-
- HandlingPriority that = (HandlingPriority) obj;
-
- return Objects.equals(priority, that.priority);
+ return this == obj || obj instanceof HandlingPriority other && Objects.equals(priority, other.priority);
}
@Override
@Override
public String toString() {
- return MoreObjects.toStringHelper(this)
- .add("priority", priority)
- .toString();
+ return MoreObjects.toStringHelper(this).add("priority", priority).toString();
}
}