blob: aa831fd78d86e36c705408d446ae2e4aacf07cbf [file] [log] [blame]
/*=============================================================================#
# Copyright (c) 2013, 2020 Stephan Wahlbrink and others.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
# which is available at https://www.apache.org/licenses/LICENSE-2.0.
#
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
#
# Contributors:
# Stephan Wahlbrink <sw@wahlbrink.eu> - initial API and implementation
#=============================================================================*/
package org.eclipse.statet.internal.ltk.core;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.eclipse.statet.ltk.core.IModelTypeDescriptor;
public class ModelTypeDescriptor implements IModelTypeDescriptor {
private final String id;
List<String> secondaryTypeIds= new ArrayList<>(1);
List<String> checkedSecondaryTypeIds;
public ModelTypeDescriptor(final String id) {
this.id= id;
}
@Override
public String getId() {
return this.id;
}
@Override
public Collection<String> getSecondaryTypeIds() {
return this.checkedSecondaryTypeIds;
}
@Override
public int hashCode() {
return this.id.hashCode();
}
@Override
public boolean equals(final Object obj) {
return (obj instanceof ModelTypeDescriptor
&& this.id == ((ModelTypeDescriptor) obj).id);
}
@Override
public String toString() {
return this.id;
}
}