/*
 * Copyright 2020 Red Hat, Inc. and/or its affiliates.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.optaplanner.core.api.domain.common;

import org.optaplanner.core.api.domain.variable.PlanningVariable;

/**
 * Determines how members (fields and methods) of the domain (for example the {@link PlanningVariable planner variable})
 * are accessed.
 */
public enum DomainAccessType {
    /**
     * Use reflection to read/write members (fields and methods) of the domain.
     * <p>
     * When used in a modulepath, the module must be open.
     * When used in GraalVM, the domain must be open for reflection.
     * <p>
     * This is the default, except with optaplanner-quarkus.
     */
    REFLECTION,
    /**
     * Use Gizmo generated bytecode to access members (fields and methods) to avoid reflection
     * for additional performance.
     * <p>
     * With optaplanner-quarkus, this bytecode is generated at build time
     * and it supports planning annotations on non-public members too.
     * <p>
     * Without optaplanner-quarkus, this bytecode is generated at bootstrap runtime
     * and you must add Gizmo in your classpath or modulepath
     * and use planning annotations on public members only.
     */
    GIZMO
}
