/* * 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.semantics.lang.dl; @Deprecated public class HypoProperty { private DLTest goal; private String predicate; private Object subject; private Object object; public HypoProperty(String pred, Object subject, Object object, DLTest goal) { this.setSubject(subject); this.setPredicate(pred); this.setObject(object); this.setGoal(goal); } public void setGoal(DLTest goal) { this.goal = goal; } public DLTest getGoal() { return goal; } @Override public String toString() { return predicate+"("+subject+";"+object+")"; } public String getLabel() { return toString(); } public String getPredicate() { return predicate; } public void setPredicate(String predicate) { this.predicate = predicate; } public Object getSubject() { return subject; } public void setSubject(Object subject) { this.subject = subject; } public Object getObject() { return object; } public void setObject(Object object) { this.object = object; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((goal == null) ? 0 : goal.hashCode()); result = prime * result + ((object == null) ? 0 : object.hashCode()); result = prime * result + ((predicate == null) ? 0 : predicate.hashCode()); result = prime * result + ((subject == null) ? 0 : subject.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; HypoProperty other = (HypoProperty) obj; if (goal == null) { if (other.goal != null) return false; } else if (!goal.equals(other.goal)) return false; if (object == null) { if (other.object != null) return false; } else if (!object.equals(other.object)) return false; if (predicate == null) { if (other.predicate != null) return false; } else if (!predicate.equals(other.predicate)) return false; if (subject == null) { if (other.subject != null) return false; } else if (!subject.equals(other.subject)) return false; return true; } }