Package org.apache.creadur.whisker.model
Class Resource
java.lang.Object
org.apache.creadur.whisker.model.Resource
- All Implemented Interfaces:
Comparable<Resource>
,ContentElement
A resource expected in a software distribution.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Accepts a visitor.int
Comparison happens based on name.boolean
Based on name.getName()
Gets the name for this resource expected in a software distribution.Gets an identifier for the optional NOTICE.Gets a locator for the source.int
hashCode()
Based on name.boolean
Is this resource linked to source?toString()
Gets a description suitable for logging.
-
Constructor Details
-
Resource
Constructs a resource in a software distribution.- Parameters:
name
- not nullnoticeId
- identifies the notice for this resource, null when there is no NOTICEsource
- describes how source may be obtained, null when this is not needed
-
-
Method Details
-
getName
Gets the name for this resource expected in a software distribution.- Returns:
- not null
-
getNoticeId
Gets an identifier for the optional NOTICE.- Returns:
- an identifier for the NOTICE, or null when the resource has no NOTICE
-
hashCode
public int hashCode()Based on name. -
equals
Based on name. -
toString
Gets a description suitable for logging. -
compareTo
Comparison happens based on name.- Specified by:
compareTo
in interfaceComparable<Resource>
- Parameters:
other
- resource to compare to.- Returns:
- result of comparison based on name
- See Also:
-
accept
Accepts a visitor.- Specified by:
accept
in interfaceContentElement
- Parameters:
visitor
- possibly null
-
getSource
Gets a locator for the source.- Returns:
- a source locator, possibly null
-
hasSource
public boolean hasSource()Is this resource linked to source?- Returns:
- true when this resource has linked source, false otherwise
-