001 /* 002 * Copyright 2010-2015 JetBrains s.r.o. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017 package org.jetbrains.kotlin.resolve.jvm.jvmSignature; 018 019 import org.jetbrains.annotations.NotNull; 020 import org.jetbrains.org.objectweb.asm.Type; 021 022 public final class JvmMethodParameterSignature { 023 private final Type asmType; 024 private final JvmMethodParameterKind kind; 025 026 public JvmMethodParameterSignature(@NotNull Type asmType, @NotNull JvmMethodParameterKind kind) { 027 this.asmType = asmType; 028 this.kind = kind; 029 } 030 031 @NotNull 032 public Type getAsmType() { 033 return asmType; 034 } 035 036 @NotNull 037 public JvmMethodParameterKind getKind() { 038 return kind; 039 } 040 041 @Override 042 public boolean equals(Object o) { 043 if (this == o) return true; 044 if (!(o instanceof JvmMethodParameterSignature)) return false; 045 046 JvmMethodParameterSignature that = (JvmMethodParameterSignature) o; 047 return asmType.equals(that.asmType) && kind == that.kind; 048 } 049 050 @Override 051 public int hashCode() { 052 return 31 * asmType.hashCode() + kind.hashCode(); 053 } 054 055 @Override 056 public String toString() { 057 return kind + " " + asmType; 058 } 059 }