
io.github.mmm.crypto.crypt.AbstractGetCryptorFactory Maven / Gradle / Ivy
package io.github.mmm.crypto.crypt;
/**
* Abstract interface to {@link #getCryptorFactory() get} the {@link CryptorFactory}.
*
* @param the type of the {@link CryptorFactory}.
* @author Joerg Hohwiller (hohwille at users.sourceforge.net)
* @since 1.0.0
*/
public abstract interface AbstractGetCryptorFactory {
/**
* @return the {@link CryptorFactory}.
*/
C getCryptorFactory();
/**
* @throws IllegalStateException if {@link #getCryptorFactory()} is {@code null}.
* @return the {@link CryptorFactory}. Never {@code null}.
*/
default C getCryptorFactoryRequired() {
C factory = getCryptorFactory();
if (factory == null) {
throw new IllegalStateException("CryptorFactory is not available!");
}
return factory;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy