1 package org.apache.archiva.metadata.repository.storage.maven2;
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
22 import org.apache.archiva.metadata.model.MetadataFacet;
24 import java.util.HashMap;
27 public class MavenArtifactFacet
28 implements MetadataFacet
30 private String classifier;
34 private String timestamp;
36 private int buildNumber;
38 public static final String FACET_ID = "org.apache.archiva.metadata.repository.storage.maven2.artifact";
40 public String getClassifier()
45 public void setClassifier( String classifier )
47 this.classifier = classifier;
50 public String getType()
55 public void setType( String type )
60 public String getTimestamp()
65 public void setTimestamp( String timestamp )
67 this.timestamp = timestamp;
70 public int getBuildNumber()
75 public void setBuildNumber( int buildNumber )
77 this.buildNumber = buildNumber;
80 public String getFacetId()
85 public String getName()
87 // TODO: not needed, perhaps artifact/version metadata facet should be separate interface?
91 public Map<String, String> toProperties()
93 HashMap<String, String> properties = new HashMap<String, String>();
94 properties.put( FACET_ID + ":type", type );
95 properties.put( FACET_ID + ":classifier", classifier );
96 properties.put( FACET_ID + ":timestamp", timestamp );
97 properties.put( FACET_ID + ":buildNumber", Integer.toString( buildNumber ));
101 public void fromProperties( Map<String, String> properties )
103 type = properties.get( FACET_ID + ":type" );
104 classifier = properties.get( FACET_ID + ":classifier" );
105 timestamp = properties.get( FACET_ID + ":timestamp" );
106 String buildNumber = properties.get( FACET_ID + ":buildNumber" );
107 if ( buildNumber != null )
109 this.buildNumber = Integer.valueOf( buildNumber );