public class Project extends java.lang.Object implements Identifiable, java.io.Serializable, FluentStyle
Modifier and Type | Field and Description |
---|---|
static Property<java.util.Date> |
CREATED_ON |
static Property<java.util.Set<CustomField>> |
CUSTOM_FIELDS |
static Property<java.lang.Integer> |
DATABASE_ID
database ID
|
static Property<java.lang.String> |
DESCRIPTION |
static Property<java.lang.String> |
HOMEPAGE |
static Property<java.lang.Boolean> |
INHERIT_MEMBERS |
static Property<java.lang.String> |
NAME
Can contain any symbols
|
static Property<java.lang.Integer> |
PARENT_DATABASE_ID
This is the *database ID*, not a String-based key.
|
static Property<java.lang.Boolean> |
PUBLIC |
static Property<java.lang.String> |
STRING_IDENTIFIER
String "identifier" (human-readable name without spaces and other extra stuff)
|
static Property<java.util.Set<Tracker>> |
TRACKERS
Trackers available for this project
|
static Property<java.util.Date> |
UPDATED_ON |
Constructor and Description |
---|
Project(Transport transport) |
Project(Transport transport,
java.lang.String name,
java.lang.String key) |
Modifier and Type | Method and Description |
---|---|
Project |
addCustomFields(java.util.Collection<CustomField> customFields) |
void |
addTrackers(java.util.Collection<Tracker> trackers) |
Project |
create()
Sample usage:
|
void |
delete()
The project object must have projectKey set (String-based identifier like "project-ABC",
NOT a database numeric ID!)
|
boolean |
equals(java.lang.Object o) |
java.util.Date |
getCreatedOn() |
CustomField |
getCustomFieldById(int customFieldId) |
java.util.Collection<CustomField> |
getCustomFields() |
java.lang.String |
getDescription() |
java.lang.String |
getHomepage() |
java.lang.Integer |
getId() |
java.lang.String |
getIdentifier() |
java.lang.Boolean |
getInheritMembers() |
java.lang.String |
getName() |
java.lang.Integer |
getParentId()
Redmine's REST API "get project" operation does NOT return the
parent project ID in redmine 1.1.2 (and maybe earlier).
|
java.lang.Boolean |
getProjectPublic()
Deprecated.
|
PropertyStorage |
getStorage() |
Tracker |
getTrackerByName(java.lang.String trackerName) |
java.util.Collection<Tracker> |
getTrackers() |
java.util.Date |
getUpdatedOn() |
int |
hashCode() |
Project |
setCreatedOn(java.util.Date createdOn) |
Project |
setDescription(java.lang.String description) |
Project |
setHomepage(java.lang.String homepage) |
Project |
setId(java.lang.Integer id) |
Project |
setIdentifier(java.lang.String identifier) |
Project |
setInheritMembers(java.lang.Boolean inheritMembers) |
Project |
setName(java.lang.String name) |
Project |
setParentId(java.lang.Integer parentId) |
Project |
setProjectPublic(java.lang.Boolean projectPublic) |
void |
setTransport(Transport transport) |
Project |
setUpdatedOn(java.util.Date updatedOn) |
java.lang.String |
toString() |
void |
update() |
public static final Property<java.lang.Integer> DATABASE_ID
public static final Property<java.lang.String> STRING_IDENTIFIER
public static final Property<java.lang.String> NAME
public static final Property<java.lang.String> DESCRIPTION
public static final Property<java.lang.String> HOMEPAGE
public static final Property<java.util.Date> CREATED_ON
public static final Property<java.util.Date> UPDATED_ON
public static final Property<java.lang.Integer> PARENT_DATABASE_ID
public static final Property<java.lang.Boolean> PUBLIC
public static final Property<java.lang.Boolean> INHERIT_MEMBERS
public static final Property<java.util.Set<CustomField>> CUSTOM_FIELDS
public Project(Transport transport)
public Project(Transport transport, java.lang.String name, java.lang.String key)
public Project setId(java.lang.Integer id)
public java.lang.String getHomepage()
public Project setHomepage(java.lang.String homepage)
public java.lang.String getIdentifier()
public Project setIdentifier(java.lang.String identifier)
public java.lang.Integer getId()
getId
in interface Identifiable
public java.lang.String getName()
public Project setName(java.lang.String name)
name
- the project namepublic java.util.Collection<Tracker> getTrackers()
public void addTrackers(java.util.Collection<Tracker> trackers)
public Tracker getTrackerByName(java.lang.String trackerName)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getDescription()
public Project setDescription(java.lang.String description)
public java.util.Date getCreatedOn()
public Project setCreatedOn(java.util.Date createdOn)
public java.util.Date getUpdatedOn()
public Project setUpdatedOn(java.util.Date updatedOn)
public java.lang.Integer getParentId()
public Project setParentId(java.lang.Integer parentId)
@Deprecated public java.lang.Boolean getProjectPublic()
null
if the project visibility was not specified or if the project was just retrieved from server.public Project setInheritMembers(java.lang.Boolean inheritMembers)
public java.lang.Boolean getInheritMembers()
public Project setProjectPublic(java.lang.Boolean projectPublic)
public java.util.Collection<CustomField> getCustomFields()
public Project addCustomFields(java.util.Collection<CustomField> customFields)
public CustomField getCustomFieldById(int customFieldId)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public PropertyStorage getStorage()
public void setTransport(Transport transport)
setTransport
in interface FluentStyle
public Project create() throws RedmineException
Project project = new Project(transport);
Long timeStamp = Calendar.getInstance().getTimeInMillis();
String key = "projkey" + timeStamp;
String name = "project number " + timeStamp;
String description = "some description for the project";
project.setIdentifier(key)
.setName(name)
.setDescription(description)
.create();
RedmineAuthenticationException
- invalid or no API access key is used with the server, which
requires authorization. Check the constructor arguments.RedmineException
public void update() throws RedmineException
RedmineException
public void delete() throws RedmineException
RedmineAuthenticationException
- invalid or no API access key is used with the server, which
requires authorization. Check the constructor arguments.NotFoundException
- if the project with this key is not foundRedmineException