1 /*******************************************************************************
\r
2 * Copyright (c) 2010 Association for Decentralized Information Management in
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.databoard.binding.reflection;
\r
14 import org.simantics.databoard.binding.RecordBinding;
\r
15 import org.simantics.databoard.binding.error.BindingConstructionException;
\r
18 * RecordBinding that represents a class
\r
20 public abstract class ClassBinding extends RecordBinding {
\r
22 public final ClassInfo ci;
\r
25 * Create binding for a class.
\r
28 * @throws BindingConstructionException
\r
30 public ClassBinding(ClassInfo ci)
\r
36 * Create binding for a class.
\r
39 * @throws BindingConstructionException
\r
41 public ClassBinding(Class<?> clazz) throws BindingConstructionException
\r
43 this( ClassInfo.getInfo(clazz) );
\r
46 public Class<?> getClazz()
\r
52 protected boolean baseEquals(Object obj) {
\r
53 return super.baseEquals(obj) && ((ClassBinding)obj).ci.equals(ci);
\r
57 public int baseHashCode() {
\r
58 return super.baseHashCode() + 17 * ci.hashCode();
\r