1 /*******************************************************************************
2 * Copyright (c) 2010 Association for Decentralized Information Management in
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.databoard.adapter;
14 import org.simantics.databoard.binding.Binding;
16 public class AdapterRequest {
22 public AdapterRequest(Binding domain, Binding range)
24 if (domain==null||range==null) throw new IllegalArgumentException("null arg");
29 public AdapterRequest(Binding domain, Binding range, boolean mustClone)
31 if (domain==null||range==null) throw new IllegalArgumentException("null arg");
34 this.mustClone = mustClone;
37 public Binding getDomain() {
41 public Binding getRange() {
46 public int hashCode() {
47 return domain.hashCode() + 31*range.hashCode() + (mustClone ? 1 : 0);
51 public boolean equals(Object obj) {
52 if (obj == null) return false;
53 if (obj instanceof AdapterRequest == false) return false;
54 AdapterRequest other = (AdapterRequest) obj;
55 return other.domain.equals(domain) && other.range.equals(range) && mustClone==other.mustClone;