/** * Clones a list of plugins. * * This method exists because ArchivaModelCloner.clonePlugins() * only works with artifact references. * * @param plugins * @return list of cloned plugins */ private static List<Plugin> clonePlugins(List<Plugin> plugins) { if (plugins == null) { return null; } List<Plugin> result = new ArrayList<>(); for (Plugin plugin : plugins) { Plugin clonedPlugin = new Plugin(); clonedPlugin.setArtifactId(plugin.getArtifactId()); clonedPlugin.setName(plugin.getName()); clonedPlugin.setPrefix(plugin.getPrefix()); result.add(plugin); } return result; }
@Override public int compare( Plugin plugin, Plugin plugin2 ) { if ( plugin.getPrefix() != null && plugin2.getPrefix() != null ) { return plugin.getPrefix().compareTo( plugin2.getPrefix() ); } if ( plugin.getName() != null && plugin2.getName() != null ) { return plugin.getName().compareTo( plugin2.getName() ); } // we assume artifactId is not null which sounds good :-) return plugin.getArtifactId().compareTo( plugin2.getArtifactId() ); } }
Plugin p = new Plugin(); p.setPrefix( plugin.elementTextTrim( "prefix" ) ); p.setArtifactId( plugin.elementTextTrim( "artifactId" ) ); p.setName( plugin.elementTextTrim( "name" ) ); metadata.addPlugin( p );
/** * Method equals. * * @param other * @return boolean */ public boolean equals( Object other ) { if ( this == other ) { return true; } if ( !( other instanceof Plugin ) ) { return false; } Plugin that = (Plugin) other; boolean result = true; result = result && ( getArtifactId() == null ? that.getArtifactId() == null : getArtifactId().equals( that.getArtifactId() ) ); return result; } //-- boolean equals( Object )
Plugin p = new Plugin(); p.setPrefix( plugin.elementTextTrim( "prefix" ) ); p.setArtifactId( plugin.elementTextTrim( "artifactId" ) ); p.setName( plugin.elementTextTrim( "name" ) ); metadata.addPlugin( p );
p.addElement( "prefix" ).setText( plugin.getPrefix() ); p.addElement( "artifactId" ).setText( plugin.getArtifactId() ); addOptionalElementText( p, "name", plugin.getName() );
/** * Method equals. * * @param other * @return boolean */ public boolean equals( Object other ) { if ( this == other ) { return true; } if ( !( other instanceof Plugin ) ) { return false; } Plugin that = (Plugin) other; boolean result = true; result = result && ( getArtifactId() == null ? that.getArtifactId() == null : getArtifactId().equals( that.getArtifactId() ) ); return result; } //-- boolean equals( Object )
/** * Method toString. * * @return String */ public java.lang.String toString() { StringBuilder buf = new StringBuilder( 128 ); buf.append( "artifactId = '" ); buf.append( getArtifactId() ); buf.append( "'" ); return buf.toString(); } //-- java.lang.String toString()
/** * Method toString. * * @return String */ public java.lang.String toString() { StringBuilder buf = new StringBuilder( 128 ); buf.append( "artifactId = '" ); buf.append( getArtifactId() ); buf.append( "'" ); return buf.toString(); } //-- java.lang.String toString()