Skip to content

Commit

Permalink
Fix tuple compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
xDec0de committed Oct 7, 2024
1 parent ca12bbc commit 917d240
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package net.codersky.mcutils.java.tuple.pair;

import javax.annotation.Nullable;
import org.jetbrains.annotations.Nullable;

/**
* An implementation of {@link Pair} that doesn't allow the modification
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package net.codersky.mcutils.java.tuple.pair;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
* An implementation of {@link Pair} that allows changing the
Expand Down Expand Up @@ -36,7 +36,7 @@ public MutablePair(@Nullable F first, @Nullable S second) {
this.second = second;
}

@Nonnull
@NotNull
@Override
public F getFirst() {
return first;
Expand All @@ -57,7 +57,7 @@ public F setFirst(@Nullable F first) {
return (this.first = first);
}

@Nonnull
@NotNull
@Override
public S getSecond() {
return second;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package net.codersky.mcutils.java.tuple.pair;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
* A class capable of storing two instance of generic
Expand Down Expand Up @@ -62,7 +62,7 @@ public interface Pair<F, S> {
*
* @see #getFirst()
*/
default boolean isFirstEqual(@Nonnull Pair<F, ?> other) {
default boolean isFirstEqual(@NotNull Pair<F, ?> other) {
return getFirst() == null ? other.getFirst() == null : getFirst().equals(other.getFirst());
}

Expand All @@ -82,7 +82,7 @@ default boolean isFirstEqual(@Nonnull Pair<F, ?> other) {
*
* @see #getSecond()
*/
default boolean isSecondEqual(@Nonnull Pair<?, S> other) {
default boolean isSecondEqual(@NotNull Pair<?, S> other) {
return getSecond() == null ? other.getSecond() == null : getSecond().equals(other.getSecond());
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package net.codersky.mcutils.java.tuple.pair;

import javax.annotation.Nonnull;
import org.jetbrains.annotations.NotNull;

import java.util.Objects;

Expand Down Expand Up @@ -32,7 +32,7 @@ public class SafeImmutablePair<F, S> extends ImmutablePair<F, S> implements Safe
*
* @since MCUtils 1.0.0
*/
public SafeImmutablePair(@Nonnull F first, @Nonnull S second) {
public SafeImmutablePair(@NotNull F first, @NotNull S second) {
super(Objects.requireNonNull(first), Objects.requireNonNull(second));
}

Expand All @@ -47,7 +47,7 @@ public SafeImmutablePair(@Nonnull F first, @Nonnull S second) {
*
* @since MCUtils 1.0.0
*/
@Nonnull
@NotNull
@Override
@SuppressWarnings("DataFlowIssue")
public F getFirst() {
Expand All @@ -63,7 +63,7 @@ public F getFirst() {
*
* @since MCUtils 1.0.0
*/
@Nonnull
@NotNull
@Override
@SuppressWarnings("DataFlowIssue")
public S getSecond() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package net.codersky.mcutils.java.tuple.pair;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.Objects;

Expand Down Expand Up @@ -33,7 +33,7 @@ public class SafeMutablePair<F, S> extends MutablePair<F, S> implements SafePair
*
* @since MCUtils 1.0.0
*/
public SafeMutablePair(@Nonnull F first, @Nonnull S second) {
public SafeMutablePair(@NotNull F first, @NotNull S second) {
super(Objects.requireNonNull(first), Objects.requireNonNull(second));
}

Expand All @@ -48,7 +48,7 @@ public SafeMutablePair(@Nonnull F first, @Nonnull S second) {
*
* @since MCUtils 1.0.0
*/
@Nonnull
@NotNull
@Override
@SuppressWarnings("DataFlowIssue")
public F getFirst() {
Expand All @@ -68,7 +68,7 @@ public F getFirst() {
* @since MCUtils 1.0.0
*/
@Nullable
public F setFirst(@Nonnull F first) {
public F setFirst(@NotNull F first) {
return super.setFirst(Objects.requireNonNull(first));
}

Expand All @@ -81,7 +81,7 @@ public F setFirst(@Nonnull F first) {
*
* @since MCUtils 1.0.0
*/
@Nonnull
@NotNull
@Override
@SuppressWarnings("DataFlowIssue")
public S getSecond() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package net.codersky.mcutils.java.tuple.pair;

import javax.annotation.Nonnull;
import org.jetbrains.annotations.NotNull;

/**
* An extension of the {@link Pair} interface that requires
Expand Down Expand Up @@ -28,7 +28,7 @@ public interface SafePair<F, S> extends Pair<F, S> {
*
* @since MCUtils 1.0.0
*/
@Nonnull
@NotNull
F getFirst();

/**
Expand All @@ -40,6 +40,6 @@ public interface SafePair<F, S> extends Pair<F, S> {
*
* @since MCUtils 1.0.0
*/
@Nonnull
@NotNull
S getSecond();
}

0 comments on commit 917d240

Please sign in to comment.