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