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

com.memority.toolkit.rule.api.ComputeRule Maven / Gradle / Ivy

Go to download

This artifact provides the API classes that are necessary to implement the contracts of Memority configuration Rules.

There is a newer version: 3.43.1
Show newest version
/*
 * Copyright (c) 2016-2023 Memority. All Rights Reserved.
 *
 * This file is part of Memority Toolkit API , a Memority project.
 *
 * This file is released under the Memority Public Artifacts End-User License Agreement,
 * see 
 * Unauthorized copying of this file, via any medium is strictly prohibited.
 */
package com.memority.toolkit.rule.api;

import com.memority.toolkit.rule.api.context.Context;

/**
 * A compute Rule is used to compute a value by using the Context only. The type of the returned
 * value is not fixed (it can be anything) and depends on when the Rule is going to get used.
 *
 * @see Context
 */
public interface ComputeRule extends Rule {

    @Override
    default RuleType getRuleType() {
        return RuleType.COMPUTE;
    }

    /**
     * Run the Compute Rule with the given context and return the computation result.
     *
     * @param context the execution context
     * @return the compute result, which may be null
     */
    Object compute(final Context context);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy