Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright 2011 JBoss Inc
  *
  * 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.drools.planner.api.domain.variable;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.*;

Specifies that a bean property should be optimized by Drools Planner.

It is specified on a getter of a java bean property of a class with the PlanningEntity annotation.

public @interface PlanningVariable {
    // TODO Add null
    // boolean nullable() default false;

    
Allows a collection of planning values for this variable to be sorted by strength.

Do not use together with strengthWeightFactoryClass().

Returns:
NullStrengthComparator when it is null (workaround for annotation limitation)
    public Class<? extends ComparatorstrengthComparatorClass() default NullStrengthComparator.class;
    interface NullStrengthComparator extends Comparator {}

    
Allows a collection of planning values for this variable to be sorted by strength.

Do not use together with strengthComparatorClass().

Returns:
NullStrengthWeightFactory when it is null (workaround for annotation limitation)
See also:
PlanningValueStrengthWeightFactory
            default NullStrengthWeightFactory.class;
New to GrepCode? Check out our FAQ X