
global.namespace.truelicense.api.LicenseFunctionComposition Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of truelicense-api Show documentation
Show all versions of truelicense-api Show documentation
The TrueLicense API module provides an Application Programming
Interface for license management on the Java Virtual Machine.
/*
* Copyright (C) 2005 - 2019 Schlichtherle IT Services.
* All rights reserved. Use is subject to license terms.
*/
package global.namespace.truelicense.api;
/**
* A strategy for composing two {@link LicenseInitialization}s or
* {@link LicenseValidation}s.
*/
public enum LicenseFunctionComposition {
override {
@Override
public LicenseInitialization compose(LicenseInitialization first, LicenseInitialization second) {
return first;
}
@Override
public LicenseValidation compose(LicenseValidation first, LicenseValidation second) { return first; }
},
decorate {
@Override
public LicenseInitialization compose(final LicenseInitialization first, final LicenseInitialization second) {
return bean -> {
first.initialize(bean);
second.initialize(bean);
};
}
@Override
public LicenseValidation compose(final LicenseValidation first, final LicenseValidation second) {
return bean -> {
first.validate(bean);
second.validate(bean);
};
}
};
public abstract LicenseInitialization compose(LicenseInitialization first, LicenseInitialization second);
public abstract LicenseValidation compose(LicenseValidation first, LicenseValidation second);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy