org.codehaus.mojo.versions.model.Rule Maven / Gradle / Ivy
// =================== DO NOT EDIT THIS FILE ====================
// Generated by Modello 1.8.3,
// any modifications will be overwritten.
// ==============================================================
package org.codehaus.mojo.versions.model;
/**
*
* Describes a rule for how versions of artifacts should be
* handled. This is marked deprecated and will be removed with
* release 3.0.0 of the versions-maven-plugin.
*
*
* @version $Revision$ $Date$
*/
@SuppressWarnings( "all" )
public class Rule
implements java.io.Serializable
{
//--------------------------/
//- Class/Member Variables -/
//--------------------------/
/**
* Field ignoreVersions.
*/
private java.util.List ignoreVersions;
/**
*
* The for groupId to which this rule applies.
* Wildcards with ? and * are valid.
* A rule applies to all child groupIds unless
* overridden by a subsequent rule.
* A rule without wildcards will override a rule
* with wildcards.
* A rule with ? wildcards will override a rule
* with * wildcards.
*
*/
private String groupId;
/**
*
* The artifactId to which this rule applies.
* Wildcards with ? and * are valid.
* A rule without wildcards will override a rule
* with wildcards.
* A rule with ? wildcards will override a rule
* with * wildcards.
*
*/
private String artifactId;
/**
* The comparison method that this rule specifies.
*/
private String comparisonMethod;
//-----------/
//- Methods -/
//-----------/
/**
* Method addIgnoreVersion.
*
* @param ignoreVersion
*/
public void addIgnoreVersion( IgnoreVersion ignoreVersion )
{
getIgnoreVersions().add( ignoreVersion );
} //-- void addIgnoreVersion( IgnoreVersion )
/**
* Get the artifactId to which this rule applies. Wildcards
* with ? and * are valid.
* A rule without wildcards will override a rule
* with wildcards.
* A rule with ? wildcards will override a rule
* with * wildcards.
*
* @return String
*/
public String getArtifactId()
{
return this.artifactId;
} //-- String getArtifactId()
/**
* Get the comparison method that this rule specifies.
*
* @return String
*/
public String getComparisonMethod()
{
return this.comparisonMethod;
} //-- String getComparisonMethod()
/**
* Get the for groupId to which this rule applies. Wildcards
* with ? and * are valid.
* A rule applies to all child groupIds unless
* overridden by a subsequent rule.
* A rule without wildcards will override a rule
* with wildcards.
* A rule with ? wildcards will override a rule
* with * wildcards.
*
* @return String
*/
public String getGroupId()
{
return this.groupId;
} //-- String getGroupId()
/**
* Method getIgnoreVersions.
*
* @return List
*/
public java.util.List getIgnoreVersions()
{
if ( this.ignoreVersions == null )
{
this.ignoreVersions = new java.util.ArrayList();
}
return this.ignoreVersions;
} //-- java.util.List getIgnoreVersions()
/**
* Method removeIgnoreVersion.
*
* @param ignoreVersion
*/
public void removeIgnoreVersion( IgnoreVersion ignoreVersion )
{
getIgnoreVersions().remove( ignoreVersion );
} //-- void removeIgnoreVersion( IgnoreVersion )
/**
* Set the artifactId to which this rule applies. Wildcards
* with ? and * are valid.
* A rule without wildcards will override a rule
* with wildcards.
* A rule with ? wildcards will override a rule
* with * wildcards.
*
* @param artifactId
*/
public void setArtifactId( String artifactId )
{
this.artifactId = artifactId;
} //-- void setArtifactId( String )
/**
* Set the comparison method that this rule specifies.
*
* @param comparisonMethod
*/
public void setComparisonMethod( String comparisonMethod )
{
this.comparisonMethod = comparisonMethod;
} //-- void setComparisonMethod( String )
/**
* Set the for groupId to which this rule applies. Wildcards
* with ? and * are valid.
* A rule applies to all child groupIds unless
* overridden by a subsequent rule.
* A rule without wildcards will override a rule
* with wildcards.
* A rule with ? wildcards will override a rule
* with * wildcards.
*
* @param groupId
*/
public void setGroupId( String groupId )
{
this.groupId = groupId;
} //-- void setGroupId( String )
/**
* Set version patterns to ignore for this rule.
*
* @param ignoreVersions
*/
public void setIgnoreVersions( java.util.List ignoreVersions )
{
this.ignoreVersions = ignoreVersions;
} //-- void setIgnoreVersions( java.util.List )
/**
* Creates a new empty rule.
*/
public Rule()
{
// enables no-arg construction
artifactId = "*";
comparisonMethod = "maven";
}
public String toString()
{
StringBuilder buf = new StringBuilder( 128 );
buf.append( "Rule[groupId = \"" );
buf.append( groupId );
buf.append( "\", artifactId = \"" );
buf.append( artifactId );
buf.append( "\", comparisonMethod = \"" );
buf.append( comparisonMethod );
buf.append( "\", ignoreVersions = \"" );
buf.append( ignoreVersions );
buf.append( "\"]" );
return buf.toString();
}
}