public abstract class AbstractMetadata extends java.lang.Object implements Metadata
Metadata.Nature
Constructor and Description |
---|
AbstractMetadata() |
Modifier and Type | Method and Description |
---|---|
protected static java.util.Map<java.lang.String,java.lang.String> |
copyProperties(java.util.Map<java.lang.String,java.lang.String> properties)
Copies the specified metadata properties.
|
private static <T> boolean |
eq(T s1,
T s2) |
boolean |
equals(java.lang.Object obj)
Compares this metadata with the specified object.
|
java.lang.String |
getProperty(java.lang.String key,
java.lang.String defaultValue)
Gets the specified property.
|
private static int |
hash(java.lang.Object obj) |
int |
hashCode()
Returns a hash code for this metadata.
|
private Metadata |
newInstance(java.util.Map<java.lang.String,java.lang.String> properties,
java.io.File file) |
Metadata |
setFile(java.io.File file)
Sets the file of the metadata.
|
Metadata |
setProperties(java.util.Map<java.lang.String,java.lang.String> properties)
Sets the properties for the metadata.
|
java.lang.String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getArtifactId, getFile, getGroupId, getNature, getProperties, getType, getVersion
private Metadata newInstance(java.util.Map<java.lang.String,java.lang.String> properties, java.io.File file)
public Metadata setFile(java.io.File file)
Metadata
public Metadata setProperties(java.util.Map<java.lang.String,java.lang.String> properties)
Metadata
setProperties
in interface Metadata
properties
- The properties for the metadata, may be null
.null
.public java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
Metadata
getProperty
in interface Metadata
key
- The name of the property, must not be null
.defaultValue
- The default value to return in case the property is not set, may be null
.null
if the property is not set and no default value was
provided.protected static java.util.Map<java.lang.String,java.lang.String> copyProperties(java.util.Map<java.lang.String,java.lang.String> properties)
properties
- The properties to copy, may be null
.null
.public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- The object to compare this metadata against, may be null
.true
if and only if the specified object is another Metadata
with equal coordinates,
type, nature, properties and file, false
otherwise.private static <T> boolean eq(T s1, T s2)
public int hashCode()
hashCode
in class java.lang.Object
private static int hash(java.lang.Object obj)