Skip to content

Commit

Permalink
core: More comments
Browse files Browse the repository at this point in the history
  • Loading branch information
TheElectronWill committed May 12, 2024
1 parent 3777eef commit 006dd91
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
import com.electronwill.nightconfig.core.UnmodifiableConfig;

final class Util {
/**
* Checks whether a value is empty, for a "sensible" definition of being empty.
* <p>
* Note: this method may throw an exception if the value is null.
*
* @param configValue the value to test
* @return true if the value is empty
*/
static boolean isEmpty(Object configValue) {
if (configValue instanceof Collection) {
return ((Collection<?>) configValue).isEmpty();
Expand Down Expand Up @@ -111,9 +119,8 @@ boolean isEmpty(Object instance) {

/**
* A better version of {@link Class#isAssignableFrom(Class)} that works with
* null,
* widening primitive conversions and conversions between primitive types and
* wrapper types.
* null, widening primitive conversions and conversions between primitive types
* and wrapper types.
*
* @param fieldType the type of the field
* @param valueType the type of the value
Expand Down

0 comments on commit 006dd91

Please sign in to comment.