51 lines
1.0 KiB
Plaintext
51 lines
1.0 KiB
Plaintext
package slangc.model;
|
|
|
|
import slang.data.Mappable;
|
|
|
|
public class TypeTemplateArgument extends TemplateArgument implements Mappable {
|
|
private TypeModel type;
|
|
|
|
public TypeTemplateArgument(TypeModel type) {
|
|
this.type = type;
|
|
}
|
|
|
|
public TypeModel getType() {
|
|
return type;
|
|
}
|
|
|
|
@Override
|
|
public int mappableHash() {
|
|
final int prime = 31;
|
|
int result = super.mappableHash();
|
|
result = prime * result + ((type == null) ? 0 : type.mappableHash());
|
|
return result;
|
|
}
|
|
|
|
@Override
|
|
public boolean mappableEquals(Mappable obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (!super.mappableEquals(obj)) {
|
|
return false;
|
|
}
|
|
if (!(obj instanceof TypeTemplateArgument)) {
|
|
return false;
|
|
}
|
|
TypeTemplateArgument other = (TypeTemplateArgument) obj;
|
|
if (type == null) {
|
|
if (other.type != null) {
|
|
return false;
|
|
}
|
|
} else if (!type.mappableEquals(other.type)) {
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return type == null ? "<UNRESOLVED?>" : type.fullName();
|
|
}
|
|
}
|