001/*
002 * (C) Copyright 2014 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 *
016 * Contributors:
017 *     <a href="mailto:grenard@nuxeo.com">Guillaume Renard</a>
018 *
019 */
020
021package org.nuxeo.ecm.platform.routing.core.impl.jsongraph;
022
023import java.util.List;
024import java.util.Locale;
025
026import org.nuxeo.ecm.platform.routing.core.impl.GraphNode.Transition;
027import org.nuxeo.ecm.platform.routing.core.impl.GraphNode.Point;
028
029/**
030 * @since 7.2
031 */
032public class TransitionView {
033
034    public String nodeSourceId;
035
036    public String nodeTargetId;
037
038    public String label;
039
040    public List<Point> path;
041
042    public TransitionView(String nodeSourceId, String nodeTargetId, Transition transition, Locale locale) {
043        this.nodeSourceId = nodeSourceId;
044        this.nodeTargetId = nodeTargetId;
045        this.label = JsonGraphRoute.getI18nLabel(transition.getLabel(), locale);
046        this.path = transition.getPath();
047    }
048
049    public String getLabel() {
050        return label;
051    }
052
053    public String getNodeSourceId() {
054        return nodeSourceId;
055    }
056
057    public String getNodeTargetId() {
058        return nodeTargetId;
059    }
060
061    public List<Point> getPath() {
062        return path;
063    }
064}