blob: 2ad6f40e2152e4eca9e3378f74ac37497d205ee0 [file] [log] [blame]
// Copyright (c) 2018, the R8 project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
package com.android.tools.r8.references;
import com.android.tools.r8.Keep;
/** Reference to a class type or interface type. */
@Keep
public final class ClassReference implements TypeReference {
private final String descriptor;
private ClassReference(String descriptor) {
this.descriptor = descriptor;
}
static ClassReference fromDescriptor(String descriptor) {
return new ClassReference(descriptor);
}
@Override
public boolean isClass() {
return true;
}
@Override
public String toDescriptor() {
return descriptor;
}
@Override
public boolean equals(Object o) {
return this == o;
}
@Override
public int hashCode() {
return System.identityHashCode(this);
}
}