-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Let ValueProvider return an Optional
- Loading branch information
Showing
12 changed files
with
100 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...ifier-core/src/main/java/nl/jqno/equalsverifier/internal/exceptions/NoValueException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package nl.jqno.equalsverifier.internal.exceptions; | ||
|
||
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; | ||
import nl.jqno.equalsverifier.internal.reflection.TypeTag; | ||
|
||
@SuppressFBWarnings(value = "SE_BAD_FIELD", justification = "EqualsVerifier doesn't serialize.") | ||
public class NoValueException extends MessagingException { | ||
|
||
private final TypeTag tag; | ||
|
||
public NoValueException(TypeTag tag) { | ||
super(); | ||
this.tag = tag; | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return "Could not find a value for " + tag + ". Please add prefab values for this type."; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...r-core/src/test/java/nl/jqno/equalsverifier/internal/exceptions/NoValueExceptionTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package nl.jqno.equalsverifier.internal.exceptions; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
import nl.jqno.equalsverifier.internal.reflection.TypeTag; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class NoValueExceptionTest { | ||
|
||
@Test | ||
public void description() { | ||
TypeTag tag = new TypeTag(String.class); | ||
NoValueException e = new NoValueException(tag); | ||
assertTrue(e.getDescription().contains("String")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters