001package 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 022import org.apache.maven.scm.ScmResult; 023 024import java.util.HashMap; 025import java.util.Map; 026 027/** 028 * @author Olivier Lamy 029 * @since 1.6 030 */ 031public class RemoteInfoScmResult 032 extends ScmResult 033{ 034 private static final long serialVersionUID = -5571403202068311222L; 035 036 /** 037 * depending on scm informations can be different 038 * svn: branch name / remote url 039 */ 040 private Map<String, String> branches = new HashMap<String, String>(); 041 042 /** 043 * depending on scm informations can be different 044 * svn: branch name / remote url 045 */ 046 private Map<String, String> tags = new HashMap<String, String>(); 047 048 public RemoteInfoScmResult( String commandLine, String providerMessage, String commandOutput, boolean success ) 049 { 050 super( commandLine, providerMessage, commandOutput, success ); 051 } 052 053 public RemoteInfoScmResult( String commandLine, Map<String, String> branches, Map<String, String> tags ) 054 { 055 super( commandLine, null, null, true ); 056 this.branches = branches; 057 this.tags = tags; 058 } 059 060 public Map<String, String> getBranches() 061 { 062 return branches; 063 } 064 065 public void setBranches( Map<String, String> branches ) 066 { 067 this.branches = branches; 068 } 069 070 public Map<String, String> getTags() 071 { 072 return tags; 073 } 074 075 public void setTags( Map<String, String> tags ) 076 { 077 this.tags = tags; 078 } 079 080 @Override 081 public String toString() 082 { 083 final StringBuilder sb = new StringBuilder(); 084 sb.append( "RemoteInfoScmResult" ); 085 sb.append( "{branches=" ).append( branches ); 086 sb.append( ", tags=" ).append( tags ); 087 sb.append( '}' ); 088 return sb.toString(); 089 } 090}