public String getProperty( String key, String defaultValue ) { String value = getProperties().get( key ); return ( value != null ) ? value : defaultValue; }
public String getProperty( String key, String defaultValue ) { String value = getProperties().get( key ); return ( value != null ) ? value : defaultValue; }
public Metadata setFile( File file ) { File current = getFile(); if ( ( current == null ) ? file == null : current.equals( file ) ) { return this; } return newInstance( getProperties(), file ); }
public Metadata setFile( File file ) { File current = getFile(); if ( ( current == null ) ? file == null : current.equals( file ) ) { return this; } return newInstance( getProperties(), file ); }
public Metadata setProperties( Map<String, String> properties ) { Map<String, String> current = getProperties(); if ( current.equals( properties ) || ( properties == null && current.isEmpty() ) ) { return this; } return newInstance( copyProperties( properties ), getFile() ); }
public Metadata setProperties( Map<String, String> properties ) { Map<String, String> current = getProperties(); if ( current.equals( properties ) || ( properties == null && current.isEmpty() ) ) { return this; } return newInstance( copyProperties( properties ), getFile() ); }
/** * Compares this metadata with the specified object. * * @param obj The object to compare this metadata against, may be {@code null}. * @return {@code true} if and only if the specified object is another {@link Metadata} with equal coordinates, * type, nature, properties and file, {@code false} otherwise. */ @Override public boolean equals( Object obj ) { if ( obj == this ) { return true; } else if ( !( obj instanceof Metadata ) ) { return false; } Metadata that = (Metadata) obj; return getArtifactId().equals( that.getArtifactId() ) && getGroupId().equals( that.getGroupId() ) && getVersion().equals( that.getVersion() ) && getType().equals( that.getType() ) && getNature().equals( that.getNature() ) && eq( getFile(), that.getFile() ) && eq( getProperties(), that.getProperties() ); }
/** * Compares this metadata with the specified object. * * @param obj The object to compare this metadata against, may be {@code null}. * @return {@code true} if and only if the specified object is another {@link Metadata} with equal coordinates, * type, nature, properties and file, {@code false} otherwise. */ @Override public boolean equals( Object obj ) { if ( obj == this ) { return true; } else if ( !( obj instanceof Metadata ) ) { return false; } Metadata that = (Metadata) obj; return getArtifactId().equals( that.getArtifactId() ) && getGroupId().equals( that.getGroupId() ) && getVersion().equals( that.getVersion() ) && getType().equals( that.getType() ) && getNature().equals( that.getNature() ) && eq( getFile(), that.getFile() ) && eq( getProperties(), that.getProperties() ); }