001/*
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *   http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing,
013 * software distributed under the License is distributed on an
014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 * KIND, either express or implied.  See the License for the
016 * specific language governing permissions and limitations
017 * under the License.
018 */
019package org.apache.maven.scm.command.remoteinfo;
020
021import java.util.HashMap;
022import java.util.Map;
023
024import org.apache.maven.scm.ScmResult;
025
026/**
027 * @author Olivier Lamy
028 * @since 1.6
029 */
030public class RemoteInfoScmResult extends ScmResult {
031    private static final long serialVersionUID = -5571403202068311222L;
032
033    /**
034     * depending on scm informations can be different
035     * svn: branch name / remote url
036     */
037    private Map<String, String> branches = new HashMap<>();
038
039    /**
040     * depending on scm informations can be different
041     * svn: branch name / remote url
042     */
043    private Map<String, String> tags = new HashMap<>();
044
045    public RemoteInfoScmResult(String commandLine, String providerMessage, String commandOutput, boolean success) {
046        super(commandLine, providerMessage, commandOutput, success);
047    }
048
049    public RemoteInfoScmResult(String commandLine, Map<String, String> branches, Map<String, String> tags) {
050        super(commandLine, null, null, true);
051        this.branches = branches;
052        this.tags = tags;
053    }
054
055    public Map<String, String> getBranches() {
056        return branches;
057    }
058
059    public void setBranches(Map<String, String> branches) {
060        this.branches = branches;
061    }
062
063    public Map<String, String> getTags() {
064        return tags;
065    }
066
067    public void setTags(Map<String, String> tags) {
068        this.tags = tags;
069    }
070
071    @Override
072    public String toString() {
073        final StringBuilder sb = new StringBuilder();
074        sb.append("RemoteInfoScmResult");
075        sb.append("{branches=").append(branches);
076        sb.append(", tags=").append(tags);
077        sb.append('}');
078        return sb.toString();
079    }
080}