Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package io.provis.model;

Copyright (c) 2010, 2012 Sonatype, Inc. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: Sonatype, Inc. - initial API and implementation /
 
 
 import java.io.File;
 import java.util.Map;
 
An artifact that delegates to another artifact instance. This class serves as a base for subclasses that want to carry additional data fields.
 
 public abstract class DelegatingArtifact extends AbstractArtifact {
 
   private final Artifact delegate;

  
Creates a new artifact instance that delegates to the specified artifact.

Parameters:
delegate The artifact to delegate to, must not be null.
 
   protected DelegatingArtifact(Artifact delegate) {
     if (delegate == null) {
       throw new IllegalArgumentException("delegate artifact not specified");
     }
     this. = delegate;
   }

  
Creates a new artifact instance that delegates to the specified artifact. Subclasses should use this hook to instantiate themselves, taking along any data from the current instance that was added.

Parameters:
delegate The artifact to delegate to, must not be null.
Returns:
The new delegating artifact, never null.
 
   protected abstract DelegatingArtifact newInstance(Artifact delegate);
 
   public String getGroupId() {
     return .getGroupId();
   }
 
   public String getArtifactId() {
     return .getArtifactId();
   }
 
   public String getVersion() {
     return .getVersion();
   }
 
   public Artifact setVersion(String version) {
     Artifact artifact = .setVersion(version);
     if (artifact != ) {
       return newInstance(artifact);
     }
     return this;
   }
 
   public String getBaseVersion() {
     return .getBaseVersion();
   }
 
   public boolean isSnapshot() {
     return .isSnapshot();
   }
 
   public String getClassifier() {
     return .getClassifier();
   }
 
   public String getExtension() {
     return .getExtension();
   }
 
   public File getFile() {
     return .getFile();
   }
 
   public Artifact setFile(File file) {
     Artifact artifact = .setFile(file);
     if (artifact != ) {
       return newInstance(artifact);
     }
     return this;
   }
 
   public String getProperty(String keyString defaultValue) {
     return .getProperty(keydefaultValue);
   }
  public Map<StringStringgetProperties() {
    return .getProperties();
  }
  public Artifact setProperties(Map<StringStringproperties) {
    Artifact artifact = .setProperties(properties);
    if (artifact != ) {
      return newInstance(artifact);
    }
    return this;
  }
  public boolean equals(Object obj) {
    if (obj == this) {
      return true;
    }
    if (obj instanceof DelegatingArtifact) {
      return .equals(((DelegatingArtifactobj).);
    }
    return .equals(obj);
  }
  public int hashCode() {
    return .hashCode();
  }
  public String toString() {
    return .toString();
  }
New to GrepCode? Check out our FAQ X