Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright 2010 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.core.score.constraint;
public abstract class ConstraintOccurrence implements Comparable<ConstraintOccurrence>, Serializable {
    protected String ruleId;
    protected ConstraintType constraintType;
    protected Object[] causes;
    public ConstraintOccurrence(String ruleIdObject... causes) {
        this(ruleId.causes);
    }
    public ConstraintOccurrence(String ruleIdConstraintType constraintTypeObject... causes) {
        this. = ruleId;
        this. = constraintType;
        this. = causes;
    }
    public String getRuleId() {
        return ;
    }
    public ConstraintType getConstraintType() {
        return ;
    }
    public Object[] getCauses() {
        return ;
    }
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        } else if (o instanceof ConstraintOccurrence) {
            ConstraintOccurrence other = (ConstraintOccurrenceo;
            return new EqualsBuilder()
                    .append(other.ruleId)
                    .append(other.constraintType)
                    .append(other.causes)
                    .isEquals();
        } else {
            return false;
        }
    }
    public int hashCode() {
        return new HashCodeBuilder()
                .append()
                .append()
                .append()
                .toHashCode();
    }
    public int compareTo(ConstraintOccurrence other) {
        return new CompareToBuilder()
                .append(other.ruleId)
                .append(other.constraintType)
                .append(other.causes)
                .toComparison();
    }
    public String toString() {
        return  + "/" +  + ":" + Arrays.toString();
    }
New to GrepCode? Check out our FAQ X