1 /*******************************************************************************
2 * Copyright (c) 2007, 2013 Association for Decentralized Information Management
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.objmap.graph;
14 import org.simantics.objmap.graph.impl.Mapping;
15 import org.simantics.objmap.graph.schema.IMappingSchema;
17 * Static utility methods for mappings.
18 * @author Hannu Niemistö
20 public class Mappings {
24 * Creates a new mapping based on the given mapping schema.
25 * The created mapping is not thread-safe and will not
26 * listen database changes automatically.
28 public static <Domain,Range> IMapping<Domain,Range> createWithoutListening(IMappingSchema<Domain,Range> schema) {
29 return new Mapping<Domain,Range>(schema, false);
33 * Creates a new mapping based on the given mapping schema.
34 * The created mapping is not thread-safe. It listens database
35 * changes automatically.
37 public static <Domain,Range> IMapping<Domain,Range> createWithListening(IMappingSchema<Domain,Range> schema) {
38 return new Mapping<Domain,Range>(schema, true);