Package Torello.Java
Class FriendClassError
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Error
-
- Torello.Java.FriendClassError
-
- All Implemented Interfaces:
java.io.Serializable
public class FriendClassError extends java.lang.Error
An exception that may be used in conjunction with the Friend-Class / Access-Badge Construct This Exception-Class is nothing more than a Glorified Version of thejava.util.Objects
construct which is often used -requireNonNull(...)
.
The Friend-Class Construct involves passing a Private-Class as an "Access Token" in order to ensure that methods and / or constructs are only accessible to classes- See Also:
- Serialized Form
Hi-Lited Source-Code:- View Here: Torello/Java/FriendClassError.java
- Open New Browser-Tab: Torello/Java/FriendClassError.java
File Size: 2,162 Bytes Line Count: 49 '\n' Characters Found
-
-
Field Summary
Fields Modifier and Type Field protected static long
serialVersionUID
static String
STANDARD_MESSAGE
-
Constructor Summary
Constructors Constructor FriendClassError()
FriendClassError(String message)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method static void
CHECK_NULL(Object accessBadgeAsObj)
static void
CHECK_NULL(Object accessBadgeAsObj, String message)
-
-
-
Field Detail
-
serialVersionUID
protected static final long serialVersionUID
This fulfils the SerialVersion UID requirement for all classes that implement Java'sinterface java.io.Serializable
. Using theSerializable
Implementation offered by java is very easy, and can make saving program state when debugging a lot easier. It can also be used in place of more complicated systems like "hibernate" to store data as well.
Note that Java'sjava.lang.Exception
andjava.lang.Error
classes implement theSerializable interface
, and a warning-free build expects this field be defined here.- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
protected static final long serialVersionUID = 1;
-
STANDARD_MESSAGE
public static final java.lang.String STANDARD_MESSAGE
This is the message passed to thisError's
Constructor- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final String STANDARD_MESSAGE = "Friend Class Error, Access-Badge Token has been passed null.";
-
-
Constructor Detail
-
FriendClassError
public FriendClassError()
Constructs a new Instance of this Class, using the Default-Message
-
FriendClassError
public FriendClassError(java.lang.String message)
Constructs a new Instance of this Class, using the Default-Message, with a User-Provided Extra-Message appended to the end.- Parameters:
message
- The "extra message" to append to the end of the Default-Message
-
-
Method Detail
-
CHECK_NULL
public static final void CHECK_NULL(java.lang.Object accessBadgeAsObj)
If anull
Access-Token has been passed, then theFriendClassError
throws.- Parameters:
accessBadgeAsObj
- Intended to be the Access-Badge instance that was provided.- Code:
- Exact Method Body:
if (accessBadgeAsObj == null) throw new FriendClassError();
-
CHECK_NULL
public static final void CHECK_NULL(java.lang.Object accessBadgeAsObj, java.lang.String message)
If anull
Access-Token has been passed, then theFriendClassError
throws.- Parameters:
accessBadgeAsObj
- Intended to be the Access-Badge instance that was provided.message
- Requests that a Specialized Message be tacked onto the end of the Exception-Message- Code:
- Exact Method Body:
if (accessBadgeAsObj == null) throw new FriendClassError(message);
-
-