All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.silanis.esl.sdk.internal.Asserts Maven / Gradle / Ivy

There is a newer version: 11.59.0
Show newest version
package com.silanis.esl.sdk.internal;

import com.silanis.esl.sdk.EslException;

public class Asserts {

    private Asserts() {}


    public static void genericAssert(boolean condition, String message) {
        if ( !condition ) {
            throw new EslException( message );
        }
    }

    public static void notNullOrEmpty(String assertedValue, String fieldName) {
        genericAssert( !(assertedValue == null || assertedValue.trim().isEmpty()), fieldName + " cannot be null or empty" );
    }

    public static void notNull(Object assertedValue, String fieldName) {
        genericAssert( !(assertedValue == null), fieldName + "cannot be null" );
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy