001/*
002 * (C) Copyright 2014 Nuxeo SA (http://nuxeo.com/) and contributors.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the GNU Lesser General Public License
006 * (LGPL) version 2.1 which accompanies this distribution, and is available at
007 * http://www.gnu.org/licenses/lgpl-2.1.html
008 *
009 * This library is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012 * Lesser General Public License for more details.
013 *
014 * Contributors:
015 *     <a href="mailto:grenard@nuxeo.com">Guillaume Renard</a>
016 *
017 */
018
019package org.nuxeo.ecm.platform.routing.core.impl.jsongraph;
020
021import java.util.List;
022import java.util.Locale;
023
024import org.nuxeo.ecm.platform.routing.core.impl.GraphNode.Transition;
025import org.nuxeo.ecm.platform.routing.core.impl.GraphNode.Point;
026
027/**
028 * @since 7.2
029 */
030public class TransitionView {
031
032    public String nodeSourceId;
033
034    public String nodeTargetId;
035
036    public String label;
037
038    public List<Point> path;
039
040    public TransitionView(String nodeSourceId, String nodeTargetId, Transition transition, Locale locale) {
041        this.nodeSourceId = nodeSourceId;
042        this.nodeTargetId = nodeTargetId;
043        this.label = JsonGraphRoute.getI18nLabel(transition.getLabel(), locale);
044        this.path = transition.getPath();
045    }
046
047    public String getLabel() {
048        return label;
049    }
050
051    public String getNodeSourceId() {
052        return nodeSourceId;
053    }
054
055    public String getNodeTargetId() {
056        return nodeTargetId;
057    }
058
059    public List<Point> getPath() {
060        return path;
061    }
062}