Home | History | Annotate | Download | only in typeinference
      1 package com.github.javaparser.symbolsolver.resolution.typeinference;
      2 
      3 
      4 import com.github.javaparser.resolution.types.ResolvedType;
      5 
      6 /**
      7  * @author Federico Tomassetti
      8  */
      9 public class Instantiation {
     10     private InferenceVariable inferenceVariable;
     11     private ResolvedType properType;
     12 
     13     public Instantiation(InferenceVariable inferenceVariable, ResolvedType properType) {
     14         this.inferenceVariable = inferenceVariable;
     15         this.properType = properType;
     16     }
     17 
     18     public InferenceVariable getInferenceVariable() {
     19         return inferenceVariable;
     20     }
     21 
     22     public ResolvedType getProperType() {
     23         return properType;
     24     }
     25 
     26     @Override
     27     public boolean equals(Object o) {
     28         if (this == o) return true;
     29         if (o == null || getClass() != o.getClass()) return false;
     30 
     31         Instantiation that = (Instantiation) o;
     32 
     33         if (!inferenceVariable.equals(that.inferenceVariable)) return false;
     34         return properType.equals(that.properType);
     35     }
     36 
     37     @Override
     38     public int hashCode() {
     39         int result = inferenceVariable.hashCode();
     40         result = 31 * result + properType.hashCode();
     41         return result;
     42     }
     43 
     44     @Override
     45     public String toString() {
     46         return "Instantiation{" +
     47                 "inferenceVariable=" + inferenceVariable +
     48                 ", properType=" + properType +
     49                 '}';
     50     }
     51 }
     52