1 package org.apache.archiva.rest.api.model.v2;/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing,
12 * software distributed under the License is distributed on an
13 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 * KIND, either express or implied. See the License for the
15 * specific language governing permissions and limitations
20 * Licensed to the Apache Software Foundation (ASF) under one
21 * or more contributor license agreements. See the NOTICE file
22 * distributed with this work for additional information
23 * regarding copyright ownership. The ASF licenses this file
24 * to you under the Apache License, Version 2.0 (the
25 * "License"); you may not use this file except in compliance
26 * with the License. You may obtain a copy of the License at
28 * http://www.apache.org/licenses/LICENSE-2.0
29 * Unless required by applicable law or agreed to in writing,
30 * software distributed under the License is distributed on an
31 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
32 * KIND, either express or implied. See the License for the
33 * specific language governing permissions and limitations
37 import io.swagger.v3.oas.annotations.media.Schema;
39 import java.util.ArrayList;
40 import java.util.List;
43 * @author Martin Stockhammer <martin_s@apache.org>
45 @Schema(name="MavenManagedRepository",description = "A managed repository stores artifacts locally")
46 public class MavenManagedRepository extends Repository
48 private static final long serialVersionUID = -6853748886201905029L;
50 boolean blocksRedeployments;
51 List<String> releaseSchemes = new ArrayList<>( );
53 @Schema(name="blocks_redeployments",description = "True, if redeployments to this repository are not allowed")
54 public boolean isBlocksRedeployments( )
56 return blocksRedeployments;
59 public void setBlocksRedeployments( boolean blocksRedeployments )
61 this.blocksRedeployments = blocksRedeployments;
64 @Schema(name="release_schemes", description = "The release schemes this repository is used for (e.g. RELEASE, SNAPSHOT)")
65 public List<String> getReleaseSchemes( )
67 return releaseSchemes;
70 public void setReleaseSchemes( List<String> releaseSchemes )
72 this.releaseSchemes = new ArrayList<>( releaseSchemes );
76 public boolean equals( Object o )
78 if ( this == o ) return true;
79 if ( o == null || getClass( ) != o.getClass( ) ) return false;
80 if ( !super.equals( o ) ) return false;
82 MavenManagedRepository that = (MavenManagedRepository) o;
84 if ( blocksRedeployments != that.blocksRedeployments ) return false;
85 return releaseSchemes != null ? releaseSchemes.equals( that.releaseSchemes ) : that.releaseSchemes == null;
89 public int hashCode( )
91 int result = super.hashCode( );
92 result = 31 * result + ( blocksRedeployments ? 1 : 0 );
93 result = 31 * result + ( releaseSchemes != null ? releaseSchemes.hashCode( ) : 0 );
98 public String toString( )
100 final StringBuilder sb = new StringBuilder( "ManagedRepository{" );
101 sb.append( "blocksRedeployments=" ).append( blocksRedeployments );
102 sb.append( ", releaseSchemes=" ).append( releaseSchemes );
103 sb.append( ", id='" ).append( id ).append( '\'' );
104 sb.append( ", name='" ).append( name ).append( '\'' );
105 sb.append( ", description='" ).append( description ).append( '\'' );
106 sb.append( ", type='" ).append( type ).append( '\'' );
107 sb.append( ", location='" ).append( location ).append( '\'' );
108 sb.append( ", scanned=" ).append( scanned );
109 sb.append( ", schedulingDefinition='" ).append( schedulingDefinition ).append( '\'' );
110 sb.append( ", index=" ).append( index );
111 sb.append( ", layout='" ).append( layout ).append( '\'' );
113 return sb.toString( );