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.adapter;
14 import org.simantics.databoard.binding.Binding;
\r
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)
\r
31 if (domain==null||range==null) throw new IllegalArgumentException("null arg");
\r
32 this.domain = domain;
\r
34 this.mustClone = mustClone;
\r
37 public Binding getDomain() {
41 public Binding getRange() {
46 public int hashCode() {
47 return domain.hashCode() + 31*range.hashCode() + (mustClone ? 1 : 0);
\r
51 public boolean equals(Object obj) {
\r
52 if (obj == null) return false;
\r
53 if (obj instanceof AdapterRequest == false) return false;
\r
54 AdapterRequest other = (AdapterRequest) obj;
\r
55 return other.domain.equals(domain) && other.range.equals(range) && mustClone==other.mustClone;
\r